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 to Pedro
Recent posts
- LudumDare59 : Signal
- Unity Editor: Tree Generator
- Leaf/Foliage Generator Tools (Runs in Browser)
- Testing Unity AI Beta
- Ways to Support UnityCoder Development
- Using UI Slider to Create 5-Star Rating Element
- Game Music Library For Unity (editor plugin)
- Fontastic : Easily Test Fonts in Unity Editor!
- GeoTiff Importer & Terrain Generator for Unity
- Create Baked DropShadow for UI images
- .JP2 Ortho Image Converter to PNG/JPG/TIFF
- Convert LAS/LAZ/PLY pointclouds to GLTF (GLB) Point Meshes (standalone converter)
Recent Comments
- on Sprite Sheet Flip Book Shader
- on Sprite Sheet Flip Book Shader
- on [Asset Store] PolygonCollider2D Optimizer
- on Trajectory Test Scene 2.0
- on Vector3 maths for dummies!
- on UnityHub 3.6.0: Remove Version Control & Cloud Dashboard columns
- on Using RenderDoc with Unity (graphics debugger)
- on UI Scroll View automatic Content height
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 😉