Skip to content

Commit 8b4cd23

Browse files
committed
One more tweak in SSAO.
Just use mod(x, 6.283185307179586) as suggested by mesa developer, instead converting it to degrees and back to radians.
1 parent 19f107d commit 8b4cd23

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

data/shaders/ssao.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void main(void)
4040
float bl = 0.0;
4141
float m = log2(r) + 6 + log2(invSamples);
4242

43-
float theta = radians(mod(degrees(2. * 3.14 * tau * .5 * invSamples + phi), 360.));
43+
float theta = mod(2. * 3.14 * tau * .5 * invSamples + phi, 6.283185307179586);
4444
vec2 rotations = vec2(cos(theta), sin(theta)) * screen;
4545
vec2 offset = vec2(cos(invSamples), sin(invSamples));
4646

0 commit comments

Comments
 (0)