encode_normal.frag 128 B

12345
  1. // from Crytek "a bit more deferred CryEngine"
  2. vec2 EncodeNormal(vec3 n)
  3. {
  4. return normalize(n.xy) * sqrt(n.z * 0.5 + 0.5);
  5. }