Bug in 3D classic noise (mod289 vec4 -> vec3)

This commit is contained in:
stegu 2011-10-11 15:32:56 +02:00
parent 74dd2c2a94
commit d90a6f4e95

View File

@ -2,7 +2,7 @@
// GLSL textureless classic 3D noise "cnoise", // GLSL textureless classic 3D noise "cnoise",
// with an RSL-style periodic variant "pnoise". // with an RSL-style periodic variant "pnoise".
// Author: Stefan Gustavson (stefan.gustavson@liu.se) // Author: Stefan Gustavson (stefan.gustavson@liu.se)
// Version: 2011-08-22 // Version: 2011-10-11
// //
// Many thanks to Ian McEwan of Ashima Arts for the // Many thanks to Ian McEwan of Ashima Arts for the
// ideas for permutation and gradient selection. // ideas for permutation and gradient selection.
@ -12,7 +12,7 @@
// https://github.com/ashima/webgl-noise // https://github.com/ashima/webgl-noise
// //
vec4 mod289(vec4 x) vec3 mod289(vec3 x)
{ {
return x - floor(x * (1.0 / 289.0)) * 289.0; return x - floor(x * (1.0 / 289.0)) * 289.0;
} }