- Home /
2D Something like fog of war - things are invisible out of light stripe
As in question and image... how to achieve this effect? I want to have scene with visible things only inside some area(which is brighter than everything else)
I think in 2D you can generally occlude things by having something else placed in front of it on the Z axis. So for example in your above picture you would place that texture in front of the character, the illu$$anonymous$$ated area would just be transparent on the alpha channel and the black would be 255.
Answer by SunnyChow · Dec 26, 2016 at 11:11 AM
there are several 2d mask plugins that you can take a look in the asset store, i think you may need those.
To manage all light source, the easiest way is to render them all in a rendertexutre but it will be too big, unless your scene is very small. i think for better performance, you need to write your own component and shader, so that when you get under a light source, you only use that light source to do masking
Your answer
Follow this Question
Related Questions
2D ligting, light cone 2 Answers
Light and 2D Sprite overlapping issue 1 Answer
I can't use 2D lights 2 Answers