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
- webgl+javascript TTS
- Using Moonsharp (LUA) + Unity Webgl
- Using 3D gameobject prefabs with Unity Tilemap + NavMesh Surface
- Custom Unity Hub Project Template Preview Image/Video (using HTML+CSS in package description)
- Check if point is inside polygon 2D (using line intersection)
- UnityHub: Enable Create Project Button (without having to select Cloud Organization)
- UI: Make Tooltip background fit Text content length
- Pong-Wars in Unity
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub)
- UnityHub: Add support for custom project title (instead of folder name) or use ProductName
- Testing Unity MUSE AI
- QR Code Generator Online
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 😉