Weird normal map


Anyone noticed a weird normal map behavior when set by shader material?
here two copy of the same model sharing the same normal map with the only exception of how it is assigned to them.

There is a directional light,  set to 45 degree, who is lighting the scene.
Normal map on the left model is set by using built-in fixed material while the normal map on the right model is set by using a shader material like this:

uniform texture normal_map;
NORMALMAP = tex(normal_map, UV).xyz;

as you can notice,  the model with fixed material looks natural while it is revolving , on the contrary, the model with shader material shows a weird shading artifact, a bit like if the light was moving vertically.

Here the test case project.

  • img
    Megalomaniak Reply
    Mar 10, 2016 @ 0:39 am

    Without seeing the normalmap texture itself and not knowing if you work in linear or srgb, may I offer a guess that you might need to (re-)normalize the normalmap? Honestly though I’ve noticed a few different issues with normalmaps and directional lights, for one directional lights don’t work in orthographic view in editor(might have been shadow issues though, and wouldn’t affect the game runtime).

Skip to toolbar