opengl - Lighting 2D Objects from behind -


i working on 2.5d lighting problem. wanted create effect moon lighting 2d things behind. have ever seen solution problem this? i'm trying use normal maps on sprite in unity, looks fine-ish when moon poking out behind -- when it's behind (as in third picture), effect doesn't work -- because light 2d element in 3d, have light front, far know perhaps there's solution doesn't involve real light, shaders reveal angle-based mask. have bright (haw!) ideas?

enter image description here

enter image description here

bad

enter image description here

i'm not familiar using 2d objects i'm guess going have simulate effect using transparency , looking function calculate brightness origin (the center of moon) or (not sure if possible) maybe create 3d overlay (or backlay if will) uses material give desired look.....set transparency on 2d object allow light effects of 3d rectangle shine though..

there beter solutions, i'm throwing ideas around


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -