stk-code_catmod/data/shaders/utils/decodeNormal.frag
2014-03-21 18:17:21 +01:00

7 lines
129 B
GLSL

vec3 DecodeNormal(vec2 n)
{
float z = dot(n, n) * 2. - 1.;
vec2 xy = normalize(n) * sqrt(1. - z * z);
return vec3(xy,z);
}