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!

"@mux213 cool!"
"@mux213 I would say the time spent on terrain is not wasted at all :-)"
"@mux213 so you are in Italy and you don't tell me anything? :-D"
"@mux213 will be possible varying the texture of the particles too?"
"@mux213 awesome, it would be even better if you could add some randomness in the grass particles"
Skip to toolbar