- Home /
Normals on sphere turned sideways by normal map
When I apply any normal map using Unity's "Bump Diffuse" shader to Unity's sphere primitive. The Normals are rotated 90 degrees. Here are two images to illustrate:
Without a bump map:
With a bump map:
Notice that the illuminated portion of the sphere has changed. It looks like the light is coming from the left when the normal map is applied. I have tried different normal maps with similar results. In the case illustrated the normal map is very simple. A 50% grey uniform image imported with "create from greyscale". I would have thought that this should create a neutral normal map which should not have altered the normals on the sphere.
What am I missing in my understanding of normal maps in Unity?
Wild shot here, your normal map is not projected correctly. Check UV.
That doesn't look like a normal map in your picture (bottom right texture) to me, or not what I'm used to. $$anonymous$$ake sure you set the texture import type to a normal map (it should be blue mostly?) by clicking on the Texture in the Project folder and setting it to Normal.
Yes, a useful normal map should be mostly purplish-blue ((128, 128, 255), as chirst_r writes.) Google "normal map" and look at the pictures.
Hmmm, thanks for the remark on the color of the normal map. I had noticed it but didn't think much of it. All the normal maps in this project are that pinkish color. I checked on my other computers and they are the correct blue/indigo color. On those computers they work as expected. This looks like a problem with Unity's import. I think I am victim of the bug described here: http://answers.unity3d.com/questions/595829/normal-maps-turned-pink-and-orange.html
Answer by christoph_r · May 29, 2014 at 08:58 AM
It actually does look like a normal map, but one that, surprise, surprise, rotates the normals by 90 degrees to the left. Try changing the color in your normal map to neutral blue (128,128,255) and then import it WITHOUT creating a normal map from grayscale. Why unity turns neutral grey into that red, though, is completely beyond me.
Answer by Phong · May 30, 2014 at 10:10 PM
Thanks for the help everyone. It seems to be a bug in the importer for normal maps. All the normal maps in the entire project are that pinkish color instead of the normal indigo and they all appear to rotate the light by 90 degrees. I found this answer:
http://answers.unity3d.com/questions/595829/normal-maps-turned-pink-and-orange.html
After unsuccessful experimentation with the import settings I resorted to the same thing he did which is to copy everything over to a fresh project. All the normal maps are fine now.
In the new project the neutral grey normal map comes out indigo and works as expected.