- Home /
Lighting 2D things from behind.
I am working on a 2.5D lighting problem. I wanted to create an effect where the moon was lighting 2D things from behind. Have you ever seen a solution to a problem like this? I'm trying to use normal maps on a sprite in Unity, which looks fine-ish when the moon is poking out from behind something -- but when it's completely behind it (as in the third picture), the effect doesn't work -- because to light a 2D element in 3D, you have to light it from the front, so far as I know Perhaps there's a solution that doesn't involve real light, but only shaders which reveal an angle-based mask. Do you have any bright (HAW!) ideas?
Images: http://imgur.com/a/Qbqgm
You could use the same shader you are currently using but with inverted light direction. What shader are you using for the object?
I'm not sure I understand.... the moon doesn't light things from behind, so what you're describing as the "problem" is actually correct, no? It appears you're using a spotlight as the moon light source - I'd suggest changing that to a directional light. And if you want the sprite to be lit from the front even when there's no direct light source, try increasing the ambient light in the scene. Otherwise, I'm not really sure.
Your answer
Follow this Question
Related Questions
2d lighting effect 1 Answer
how can i write a mobile/particles/multiply shader that supports light? 0 Answers
2D Lighting Rotation Confusion 1 Answer