- Home /
Blending 2d light sprites
For pixel lighting in my 2d game, I have a secondary camera render to a RenderTexture, which I then combine with the level camera's RenderTexture using a shader to produce the lighting effect.
This works fine when all the lights are the same color, but when I try to use colors, the sprites render the normal way:
I need them to blend together instead, kind of like this:
How would I do this?
Comment
Answer by Tetracube · Jan 19, 2017 at 10:00 AM
Figured it out, the solution was to apply a Shader with BlendOp Max to every light sprite (you need a different blend mode to make it look like the image up there, but BlendOp Max was what I actually wanted).
To make the shader I just copied the source code of Sprites/Default and added BlendOp Max.