This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define sectorize(value) step(0.0, (value))*2.0-1.0 | |
#define sum(value) dot(clamp((value), 1.0, 1.0), (value)) | |
#define PI 3.141592653589793 | |
vec2 normalToUvRectOct(vec3 normal){ | |
normal /= sum(abs(normal)); | |
if(normal.y > 0.0){ | |
return normal.xz*0.5+0.5; | |
} | |
else{ |