Skip to content

Commit 4ded5f0

Browse files
author
David Sheets
committed
Move constant macro outside of top-level sl declaration
1 parent 4e01aac commit 4ded5f0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/noise4D.glsl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,16 @@ vec4 grad4(float j, vec4 ip)
4545

4646
return p;
4747
}
48+
49+
// (sqrt(5) - 1)/4 = F4, used once below
50+
#define F4 0.309016994374947451
4851

4952
float snoise(vec4 v)
5053
{
5154
const vec4 C = vec4( 0.138196601125011, // (5 - sqrt(5))/20 G4
5255
0.276393202250021, // 2 * G4
5356
0.414589803375032, // 3 * G4
5457
-0.447213595499958); // -1 + 4 * G4
55-
56-
// (sqrt(5) - 1)/4 = F4, used once below
57-
#define F4 0.309016994374947451
5858

5959
// First corner
6060
vec4 i = floor(v + dot(v, vec4(F4)) );

0 commit comments

Comments
 (0)