I need help with 2D light effect by mask or something, please!

Hi there!

I’m struggling to find a solution to solve how to handle “faked” lights as you can see in the image attached. I’m thinking in grabbing a texture (render to texture) from a transparent layer (for example “queue”= “transparent+17”) and render it in other in front of that (“queue” = "transparent+20). The idea is to “avoid” a plane with a color that tints the whole scene (p.e. at transparen+18 -) to get the original color behind and apply to it (fragment shader) the light flare texture and a geryscale mask with that form to lerp with the plane color too. But I can’t tag the grabPass in a transparent layer different than the shader (That’s one of my problems). Perhaps I’m thinking in a wrong way or someone can tell me another way to handle this problem.

Thank you very much! !

try this … note you do need a damn transparent shader, of course:

  1. get 2dToolkit
  2. drop PNG in to collection
  3. make sprite in your scene
  4. add point light
  5. sit camera in front of image. sit light behind image
  6. use any transparent shader
  7. using your mouse, move the light back and fore and you will see it shining through the sprite with incredible beauty

this image shows the light is behind the sprite, and when you move it around it moves the stained-glass lighting of the sprite

Is this what you meant?

Note for future readers – if you simply cast the light on to the FRONT OF the sprite (example, you don’t have transparent shaders available) you can get a largely similar effect, really.