Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Spherical normal encoding
// Encoding:
normalOut=normalize(normalIn.xy)*sqrt(normalIn.z*0.5+0.5);
// Decoding:
normal.z=length2(normalOut.xy)*2- 1;
normal.xy=normalize(normalOut.xy)*sqrt(1- normal.z*normal.z);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.