2D Visibility / Shadow
Started converting this 2D visibility/light script ( http://ncase.me/sight-and-light/ ) to unity, finally some progress!
btw. lines are drawn using GLDebug from : http://www.unity3d-france.com/unity/phpBB3/viewtopic.php?f=24&t=5409
Unity forum thread: http://forum.unity3d.com/threads/2d-visibility-shadow-free.275698/
– Quad segments are currently crossed..
– Fix mesh generation *Temporary fix: insert extra boxes outside the view..
– Source cleaning up
– Publish to github
– Some documentation
– Try raster version (bresenham + floodfill)
– Support for moving objects
– Sprite support (but unity indie has quad sprite mesh, no tight mesh generation..needs extra script to generate helper points for sprite image edges..?)
– Better system for finding edge segments
– 20 obstacles (~80 vertices) : ~45-50ms per frame (in editor, with slow’ish pc)
http://unitycoder.com/upload/demos/2DVisibility/v1/ (v1, still broken)
http://unitycoder.com/upload/demos/2DVisibility/v2/ (v2, almost done)
https://github.com/unitycoder/2DShadow (Please help improving the code!)
Shadow casting 2D : http://unitycoder.com/blog/2014/02/10/shadow-casting-2d/ (using pseudo angles, unfinished
Image#2: Few problems fixed, mesh still broken..somehow cannot make the light vertices go in to “correct” world space(?)
Image#3: Mesh fixed, but still starts “stretching” when mouse moves away from center..
Image#4: Good enough..(added hidden boxes outside the view, to avoid broken mesh *hidden box idea from denamond)
Image#5: Current profiler view, gets quite slow with many objects..need to start optimizing
Image#6: Testing visibility with Martt’s dual camera depth mask system (see the 2nd sphere is partly hidden)
18 Comments + Add Comment
Leave a comment
- Using ImageMagick with Unity
- Load AssetBundles with Caching
- [Shader] Draw World Space UI Always On Top
- Advanced Voxel Terrain
- Voxel Terrain
- [LudumDare37] One Room
- Wireframe Shader
- Publish .ipa file from Windows PC to iOS without Mac
- New Domain name 1darray.com
- Using Accord.NET with Unity
- Lots of Exciting New Unity Stuff Coming Up!
- How to enable unsafe keyword for Unity C#