Skip to content

Commit

Permalink
Anisotropy fix
Browse files Browse the repository at this point in the history
Increased the precision in the ONB for the up vector as this was causing tangent vector discontinuities at the poles

https://jcgt.org/published/0006/01/02/paper.pdf

Fixes issue #77
  • Loading branch information
knightcrawler25 committed Dec 24, 2022
1 parent 5c63009 commit a35af14
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/shaders/common/sampling.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ float PowerHeuristic(float a, float b)

void Onb(in vec3 N, inout vec3 T, inout vec3 B)
{
vec3 up = abs(N.z) < 0.999 ? vec3(0, 0, 1) : vec3(1, 0, 0);
vec3 up = abs(N.z) < 0.9999999 ? vec3(0, 0, 1) : vec3(1, 0, 0);
T = normalize(cross(up, N));
B = cross(N, T);
}
Expand Down

0 comments on commit a35af14

Please sign in to comment.