Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Corrected taylorInvSqrt()

  • Loading branch information...
commit 44950104b85dc72891aafcce6a0b08cd4af7ca8e 1 parent 627a54c
@stegu stegu authored
View
2  src/noise2D.glsl
@@ -70,6 +70,6 @@ float simplexNoise(vec2 v)
vec3 g = vec3( dot(a0.xy, x0), dot(a0.zw, xC.xy), dot(a1.xy, xC.zw) );
#endif
- return 160.0 * dot(m, g);
+ return 130.0 * dot(m, g);
}
View
3  src/noise3D.glsl
@@ -100,7 +100,6 @@ float simplexNoise(vec3 v)
// Mix
vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.);
m = m * m;
-//used to be 64.
- return 58.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),
+ return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),
dot(p2,x2), dot(p3,x3) ) );
}
View
2  src/noise4D.glsl
@@ -121,7 +121,7 @@ float simplexNoise(vec4 v)
vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.0);
m0 = m0 * m0;
m1 = m1 * m1;
- return 70.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))
+ return 49.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))
+ dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;
}
View
2  src/noiseStdLib.glsl
@@ -23,7 +23,7 @@ PERMFUN(vec3)
PERMFUN(vec4)
#define TAYLOR_L07(X) X taylorInvSqrt(X r) { \
- return ( 0.83666002653408 + 0.7*0.85373472095314 - 0.85373472095314 * r ); }
+ return ( 1.195228609334394 + 0.7*0.85373472095314 - 0.85373472095314 * r ); }
TAYLOR_L07(float)
TAYLOR_L07(vec2)

0 comments on commit 4495010

Please sign in to comment.
Something went wrong with that request. Please try again.