Light projection and sprites effect

Hello there,

I joined an image to this thread, showing light coming in a room from a window. This result is obtained using sprites and a layer mask, the sprites are either lit or not, depending on if they are in the “ambiantLight” layer or not.
The problem is that these sprites are made using blending modes on Photoshop and I can’t just export the “light” to add it on the other sprites behind. In other word, these sprites can’t be displayed in the foreground and affect moving characters in the scene.

I’m looking for a way to apply this light effect on static sprites but also on dynamic one and the latest could potentially be partially affected (not like in the currently used solution where all the sprites in the “ambiantLight” layer are entirely affected).

I hope my explanation is clear (if it isn’t, please ask questions!) and I’d appreciate all the advice you have. I’m open to any kind of solution (asset, C# or shader based).

Thank you for your time!

Would it be possible to use a shader on the lit sprite as masks to light other sprites that come in their bounds?

I found a solution to my problem which is actually really simple: I wrote some shaders to copy the effect of the blend modes in Photoshop so that I can directly reproduce what the artist does and don’t have to hack around to reproduce the effect on my player.

I used the formulas in the following link in order to write the shaders: http://www.deepskycolors.com/archive/2010/04/21/formulas-for-Photoshop-blending-modes.html

1 Like