- Home /
interaction flipped normal-mapped sprite and directional light
I'm trying to understand an interaction between directional light and a flipped sprite using the transparent-cutout-bumped-diffuse shader (sprite with a normal map). The flipping is done by rotating around y-axis 180 degrees and setting scale z to -1. With just a regular and a flipped sprite in the scene, everything is fine. I can duplicate the regular sprite without problems. As soon as I copy the flipped sprite, multiple flipped sprites start disappearing. If I delete or move some out of the camera, others might appear again.
The behavior doesn't occur with a point light, but I'm trying to make it work with directional light.
In the project where I ran into this problem I also have rigidbodies/colliders/joints attached for a ragdoll on death, and the typical scale x = -1 answer for sprite flipping seems to mess up the physics. This is why I'm trying do it with y rotation and flipping z for the sprite renderer to pick up light. In the testproject I didn't add the physics and applied the z invert on the parent gameobject for easy testing, but the effect is the same.
I hope someone can explain why this is happening, and can suggest a workaround.
video demonstration: https://www.youtube.com/watch?v=p7MRZvTT84g
project zip: https://drive.google.com/file/d/0ByZ6h0p6snSid05CR2JmU1U4U00/view?usp=sharing