- Home /
Apply a shader to multiple 2D sprites
I want to apply a single shader pass to a layer of multiple sprites, so that the sprites can use each other's information and blend together in interesting ways. The simplest case would be one background image and one player image moving around in front of it. What is the best way for me to do this?
Thanks for any advice!
Answer by usedtobeadoctor · Sep 20, 2017 at 05:11 AM
The solution that I found was to apply a shader to the camera with a script! That way I can pass in information about the character specifically, and the shader can access all the visible sprites and fragments on the screen, giving a more unified effect than simply applying the same material to multiple sprites.
dude i know its an old question but can you explain this in more detail? ^^ sounds like exactly what i need. a shader over the whole character not just the single sprites which makes the shading effect not fit together. i find nothing about this
Answer by vetasoft · Sep 19, 2017 at 12:08 PM
Just create a Material and use the same material for all the sprites.