I've started working on a 3D line of sight system for Unity, which could be used in top down style games.
It uses a technique very similar to (deferred) shadow mapping in addition to some custom post processing effects, shaders and scripts.
At the moment it works in both deferred and forward rendering, supports an unlimited amount of line of sight sources (technically atleast) and allows you to easily switch the image effect applied to the area outside of the line of sight.
Still need to add support for orthographic cameras and flesh out the demo scene a bit more.
Let me know what you think!
Replies
Also, with the blur going on its a bit hard to separate the foreground and background which is a bit disorienting. Perhaps the blur should be based on distance like camera focus/ depth of field.
I added a blur to the mask and a fall-off to the cones to help readability. I also swapped the blur effect with a DoF effect.
I updated the webplayer build so you can try it out if you'd like.
You could do stuff with verticality where your vision cone gets bigger or the DOF gets less intensely blurred as you climb to a higher vantage point. The camera could dolly upwards and move forward along your LOS to reveal more of the map when you point your cursor further out, as a way to peer further (possible also narrowing your cone).
Also, mirrors?
Now you just need to do something for visualizing sound/noise and you got an awesome technical settup for a stealth game!
It looks amazing!
Reminds me of Mark of the Ninja.
Made a small update to the webplayer.
I focused mostly on optimization for this update, for example making sure that (line of sight) cameras which are of screen aren't rendered, and some profiling.
I've also added basics NPC's which move around the map randomly and fade in and out of the visible area.
I'm considering turning this into a small stealth game, something like mark of the ninja gameplay wise, but than in top down 3D.
@ Ekibyou; here's a quick explanation of how the main effect works:
Then in a loop for each LOS ( line of sight ) camera:
After all the cameras have been added to the mask:
I finally managed to finish my line of sight system and it's now available on the Unity Asset Store!
Asset Store link: http://u3d.as/content/tycho-terryn/gpu-line-of-sight
Unity Forum Thread: http://forum.unity3d.com/threads/released-gpu-line-of-sight-field-of-view.257324/
Hehe, off course. I used it as an inspiration for the demo
I'm guessing they're using a similar technique as well.
Love the design and concept of your game. What are you using to develop it?