stk-code_catmod/data/shaders/utils/decodeNormal.frag

7 lines
129 B
GLSL
Raw Normal View History

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