]> git.tdb.fi Git - libs/gl.git/blobdiff - shaderlib/common.glsl
Normalize fragment normal
[libs/gl.git] / shaderlib / common.glsl
index 05648e4c0c106f469b63ed0346dc4c8b32c0c9be..4a81636037be1224d0d2856cdfd90b67d8eef3fc 100644 (file)
@@ -68,7 +68,7 @@ void main()
 vec3 get_fragment_normal()
 {
        if(use_normal_map)
-               return texture(normal_map, texcoord.xy).xyz*2.0-1.0;
+               return normalize(texture(normal_map, texcoord.xy).xyz*2.0-1.0);
        else
                return vec3(0.0, 0.0, 1.0);
 }