3
2013
2D Grid Fake Shadow

Using the same code from previous 2D Raycasting Visibility Voxel Travelsal, but added dynamic grid array update (using screenshots..), so now the walls (obstacles) are updated realtime on the 2D grid.
FEATURES:
– Converted the whole thing to C#
– Any object visible to camera can block visibility (particles also, with adjustable alpha or color..see image#2, threshold was 0.15)
– Adjustable obstacle scan (in webplayer demo 3.0, tree casts shadows only from the trunk part, not as a whole object)
– Adjustable ray & shadow step resolution
TODO:
– Using GetPixel..change to GetPixels() Done
– Make resolution adjustable (now its fixed size, 320×320 obstacle grid texture, thats why webplayer is 320×320 also) Done
– Could try this same method with the previous fake shadow shader (had problems getting a dynamic obstacle map back then..)
– Dynamic resolution? (near player = fine, far = coarse?), then scanning should be faster?
– Fade out based on distance (could be done in shader also..)
Webplayer:
http://unitycoder.com/upload/demos/VoxelTravelsalShadow/ (v2.0)
http://unitycoder.com/upload/demos/VoxelTravelsalShadow2/ (v3.0)
—
Image#2: Also particles can cast shadows (or anything that is visible to the camera..)

Related Posts
1 Comment + Add Comment
Leave a comment
Recent posts
- Adding Real World Location to Ice Fishing Prototype
- [web tool] Image Channel Inspector : AlphaScope
- Editor Tool: Smart Recompile (don’t recompile if edit comments)
- Editor Tool: Scene Size Analyzer
- LudumDare 60: Old Tech
- uBasic Scripting Language for Unity
- GreaseMonkey+Editor Plugin: 1-Click Copy script from ChatGPT (Web) to Unity Editor (as script)
- Editor Tool: Property Watcher
- .unityignore : Hide files from Project window
- PostBuild Script to Create Single exe Standalone File
- Game Loop Designer
- Favorites in PackageManager
Recent Comments
Coin:
CUgDSbRqFcAumDSAcdKDvuXsw26VdkJe8C8WGUQHBAGS
An article by












Do you plan on release this little experiments you make as open source? It would be great for those looking to see how you accomplished things 😉