Using Sprite As Mask For Shader
I am making a 2D game with some lighting-based stealth mechanics. It's an 8-bit style game, so this is not using actual engine-based lighting, but rather sprite masks on specific in game objects that mask a large black sprite attached to the camera (which is turned off and on by in game triggers). This results in large areas of the screen that are solid black, with certain areas "cut out" that are the standard colors of the assets behind the black sprite layer:
What I would like to actually do is have a shader that applies some coloration logic to the area that is now solid black, so that the sprites behind the black area are displayed in differing shades of blue. I have written the shader, but I'm trying to figure out if I can use the masking result of the black sprite and the in game "light sources" to apply the shader only to those areas behind (or masked out by) the black sprite.
Here is an example of what the shader does for reference, though the affected pixels are the opposite of what I'm trying to do:
Your answer
Follow this Question
Related Questions
Scroll view not working when children have material 1 Answer
Inverse Sprite Maskin 0 Answers
Creating a 3D lens 0 Answers
Circular Whipe Effect 0 Answers
Do I need a thousand materials or not?,, 0 Answers