Long story short, I’d like to do something like that, from the game Covert :
It’s a triangle that can be blocked by obstacles. What would be the best way to do that ? Do I have to create a mesh and use multiples raycasts ? I don’t have Unity pro, so I can’t use a depth map (not that I know of anyway).
Light is applied on surfaces, and don’t have occlusion. In the example above, it would light up the cylinder, the walls near the door, the door and part of the ground, which isn’t what I want.
maybe you go the other way round. dont handle what the camera can see but what it can not see. if camera position and obstacles are static model the dark blue regions manually (this could even include camera rotation).
this also helps you with the game logic when a player shall be spottet by the camera so as long it is in a dark blue region it is safe.
the effect could be achieved by planes with transparent materials. the one with the obstacle “shadow” is static and the one of the camera rotates around the camera point. may require to write a custom shader to do the logic of which value to pick (priorize dark blue “invisible” regions). if you tag the planes you could do this in a separate camera and overlay it with the main camera.
He’s right actually, you can simply make specific objects ignore the light. But since you don’t have pro there wouldn’t be any shadows anyway.
It would be fairly easy to do if you had pro with either spotlight, post shader or even real geo but as far as I know none of that is available in free.
There was some shadow example in asset store that supposedly works with free but I don’t know how helpful that would be.
What exiguous suggested would probably be the best method if your camera is more or less static/pre-defined