#How to make 2D occlusion occur only behind the sprite?

4 messages · Page 1 of 1 (latest)

lethal drum
#

In the screenshot I posted, I am trying to make the main char and the rats sprites be illuminated when it gets hit by light, but still create a shadow behind him

I couldn't really find a solution with the occluders and so far the only scuffed work around I have is to add a pointlight directly on top of the character like I did for the player

Any method to do this naturally?

soft quiver
#

The tricky thing is that we can't tell the lighting system to interact with the opposite side of the occlusion layers only.

Maybe you can have another sprite on top of the rats that isn't affected by shadows? But I could see that causing issues with others shadows since rats could then be lit up through walls

#

You could also use a subviewport, copy of the tilemap, and another light to generate a masking layer for where lighting/shadows should be without considering things like rats (i.e. just the terrain), and then use that as a shader to determine how the rats get lit (but I think that would also need another rat sprite in front of those rat sprites that isn't affected by the normal light)

lethal drum
#

Bump