20 #define SCURVE(a) ((a) * (a) * (3.0 - 2.0 * (a)))
23 # define REALSCALE (2.0 / 65536.0)
24 # define NREALSCALE (2.0 / 4096.0)
26 # define HASH3D(a, b, c) hashTable[hashTable[hashTable[(a)&0xfff] ^ ((b)&0xfff)] ^ ((c)&0xfff)]
27 # define HASH(a, b, c) (xtab[(xtab[(xtab[(a)&0xff] ^ (b)) & 0xff] ^ (c)) & 0xff] & 0xff)
28 # define INCRSUM(m, s, x, y, z) \
29 ((s) * (RTable[m] * 0.5 + RTable[m + 1] * (x) + RTable[m + 2] * (y) + RTable[m + 3] * (z)))
41 #define LERP(t, a, b) ((a) + (t) * ((b) - (a)))
43 #define SETUP(i, b0, b1, r0, r1) \
46 (r0) = modff((t), &(u)); \
48 (b0) = ((int)(u)) & BM; \
49 (b1) = ((b0) + 1) & BM; \
66 s =
sqrt(
v[0] *
v[0] +
v[1] *
v[1] +
v[2] *
v[2]);
77 for (
t = 0; oct > 0 && freq > 0; freq *= 2, amp /= 2, --oct) {
89 for (
t = 0; oct > 0 && freq > 0; freq *= 2, amp /= 2, --oct) {
90 vec.
x() = freq *
v.x();
91 vec.
y() = freq *
v.y();
102 for (
t = 0; oct > 0 && freq > 0; freq *= 2, amp /= 2, --oct) {
103 vec.
x() = freq *
v.x();
104 vec.
y() = freq *
v.y();
105 vec.
z() = freq *
v.z();
115 float rx0, rx1,
sx,
t, u,
v, vec;
118 SETUP(vec, bx0, bx1, rx0, rx1);
122 u = rx0 * g1[p[bx0]];
123 v = rx1 * g1[p[bx1]];
130 int bx0, bx1, by0, by1, b00, b10, b01, b11;
131 float rx0, rx1, ry0, ry1, *q,
sx,
sy,
a,
b,
t, u,
v;
134 SETUP(vec.
x(), bx0, bx1, rx0, rx1);
135 SETUP(vec.
y(), by0, by1, ry0, ry1);
148 #define AT2(rx, ry) ((rx)*q[0] + (ry)*q[1])
169 int bx0, bx1, by0, by1, bz0, bz1, b00, b10, b01, b11;
170 float rx0, rx1, ry0, ry1, rz0, rz1, *q,
sy, sz,
a,
b,
c, d,
t, u,
v;
173 SETUP(vec.
x(), bx0, bx1, rx0, rx1);
174 SETUP(vec.
y(), by0, by1, ry0, ry1);
175 SETUP(vec.
z(), bz0, bz1, rz0, rz1);
189 #define AT3(rx, ry, rz) ((rx)*q[0] + (ry)*q[1] + (rz)*q[2])
192 u =
AT3(rx0, ry0, rz0);
194 v =
AT3(rx1, ry0, rz0);
198 u =
AT3(rx0, ry1, rz0);
200 v =
AT3(rx1, ry1, rz0);
206 u =
AT3(rx0, ry0, rz1);
208 v =
AT3(rx1, ry0, rz1);
212 u =
AT3(rx0, ry1, rz1);
214 v =
AT3(rx1, ry1, rz1);
221 return LERP(sz,
c, d);
234 for (j = 0; j < 2; j++) {
239 for (j = 0; j < 3; j++) {
251 for (i = 0; i <
_NOISE_B + 2; i++) {
255 for (j = 0; j < 2; j++) {
259 for (j = 0; j < 3; j++) {
typedef float(TangentPoint)[2]
void int BLI_rng_get_int(struct RNG *rng) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_rng_free(struct RNG *rng) ATTR_NONNULL(1)
struct RNG * BLI_rng_new(unsigned int seed)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
#define SETUP(i, b0, b1, r0, r1)
Class to define Perlin noise.
ATTR_WARN_UNUSED_RESULT const BMVert * v
static unsigned long seed
float turbulence2(Vec2f &v, float freq, float amp, unsigned oct=4)
float turbulence3(Vec3f &v, float freq, float amp, unsigned oct=4)
float smoothNoise3(Vec3f &vec)
float smoothNoise1(float arg)
float turbulence1(float arg, float freq, float amp, unsigned oct=4)
float smoothNoise2(Vec2f &vec)
ccl_gpu_kernel_postfix ccl_global float int int sy
ccl_gpu_kernel_postfix ccl_global float int sx
static void normalize3(float v[3])
static void normalize2(float v[2])
static const pxr::TfToken b("b", pxr::TfToken::Immortal)