- Home /
How to make sprites become darker when in shadow?
I have 2d sprites in 3d environment, and I'd like them to get darker the more they are engulfed in shadows. The left image below is how it looks currently and the right one is how I'd like it to look. I've tried fiddling with shaders and whatnots but without a result.
So, is this possible to have sprite become darker when it is positioned in a shadow?

Answer by JCX · Jan 27, 2014 at 10:46 PM
switch the sprite to darker one, does not matter if it's pregenerated in photoshop or in unity ... it's so far the easiest way, but if you need many sprites it's doubling the number of pixels so it might affect performance
or you can use material with shader which will be affected by color and then you can just set the color of material to affect lightness of the bitmap
Actually I've found a way - it requires simple raycast from the sprite to all light sources.
Your answer
Follow this Question
Related Questions
This is not working! 1 Answer
How to morph and animate a sprite/mesh in Unity 0 Answers
Weird shading problem? (Images included) 1 Answer
Rendering only outside the fog 1 Answer