Skip to content

Commit c7ef0e7

Browse files
committed
Fix noise precision issues
1 parent fceaa75 commit c7ef0e7

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/effects/shaders/noise.frag

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ uniform float page;
22

33
vec4 mainImage(const in vec4 inputColor, const in vec2 uv, const in GData gData) {
44

5-
vec2 p = uv * (SEED + page);
5+
vec3 p = vec3(uv, SEED + page);
66

77
#ifdef RGB
88

9-
vec2 pR = p;
10-
vec2 pG = vec2(p.x + 1.0, p.y);
11-
vec2 pB = vec2(p.x, p.y + 1.0);
9+
vec3 pR = p;
10+
vec3 pG = vec3(p.x + 1.0, p.y, p.z);
11+
vec3 pB = vec3(p.x, p.y + 1.0, p.z);
1212

13-
vec3 noise = vec3(rand(pR), rand(pG), rand(pB));
13+
vec3 noise = vec3(urand(pR), urand(pG), urand(pB));
1414

1515
#else
1616

17-
vec3 noise = vec3(rand(p));
17+
vec3 noise = vec3(urand(p));
1818

1919
#endif
2020

0 commit comments

Comments
 (0)