Weird normal map

Dec
04

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;
NORMALMAP_DEPTH = 1;

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).

Popular posts

  • No popular posts!

Follow us!

"@alejo9719 very slowly at the moment because we have to finish others projects first"
"@nunodonato @reduzio often a single color is not enough for make to gracefully disappear tall objects like building… https://t.co/4Ao6ZrZGE7"
"@reduzio what about an option for blending objects affected by the fog with the skybox/panorama? It would be useful for outdoor scenes"
Skip to toolbar