]> git.tdb.fi Git - libs/gl.git/blobdiff - shaderlib/common.glsl
Load various built-in things through Resources
[libs/gl.git] / shaderlib / common.glsl
index 7222b00f4f2439c0739eeff8dec7d3d97c77c0c3..4a81636037be1224d0d2856cdfd90b67d8eef3fc 100644 (file)
@@ -65,17 +65,17 @@ void main()
 }
 
 #pragma MSP stage(fragment)
-vec3 get_normal_sample()
+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);
 }
 
 vec4 get_environment_sample(vec3 direction)
 {
-       return texture(environment, direction);
+       return texture(environment_map, direction);
 }
 
 vec3 get_reflection(vec3 normal, vec3 look)