|
Blender
V2.93
|
#include <math.h>#include "BLI_compiler_compat.h"#include "BLI_sys_types.h"#include "BLI_noise.h"Go to the source code of this file.
Macros | |
| #define | VALUE_AT(rx, ry, rz) ((rx)*q[0] + (ry)*q[1] + (rz)*q[2]) |
| #define | SURVE(t) ((t) * (t) * (3.0f - 2.0f * (t))) |
Static Data | |
| #define | HASHPNT(x, y, z) hashpntf + 3 * hash[(hash[(hash[(z)&255] + (y)) & 255] + (x)) & 255] |
| #define | hash BLI_noise_hash_uchar_512 |
| static const float | hashpntf [768] |
| const unsigned char | BLI_noise_hash_uchar_512 [512] |
| static const float | hashvectf [768] |
Improved Perlin Noise Implementation (Original) | |
| #define | SETUP(val, b0, b1, r0, r1) |
| static const char | g_perlin_data_ub [512+2] |
| static const float | g_perlin_data_v3 [512+2][3] |
| static float | noise3_perlin (const float vec[3]) |
| static float | orgBlenderNoise (float x, float y, float z) |
| static float | orgBlenderNoiseS (float x, float y, float z) |
| float | BLI_noise_hnoise (float noisesize, float x, float y, float z) |
| float | BLI_noise_turbulence (float noisesize, float x, float y, float z, int nr) |
| static float | orgPerlinNoise (float x, float y, float z) |
| static float | orgPerlinNoiseU (float x, float y, float z) |
| float | BLI_noise_hnoisep (float noisesize, float x, float y, float z) |
| #define hash BLI_noise_hash_uchar_512 |
| #define SETUP | ( | val, | |
| b0, | |||
| b1, | |||
| r0, | |||
| r1 | |||
| ) |
| #define VALUE_AT | ( | rx, | |
| ry, | |||
| rz | |||
| ) | ((rx)*q[0] + (ry)*q[1] + (rz)*q[2]) |
Returns unsigned cell-noise.
Definition at line 1125 of file noise.c.
References floor(), x, y, and z.
Referenced by BLI_noise_cell(), BLI_noise_generic_noise(), and BLI_noise_generic_turbulence().
Definition at line 1141 of file noise.c.
References BLI_cellNoiseU(), x, y, and z.
Referenced by BLI_noise_mg_fbm(), BLI_noise_mg_hetero_terrain(), BLI_noise_mg_hybrid_multi_fractal(), BLI_noise_mg_multi_fractal(), BLI_noise_mg_ridged_multi_fractal(), and BLI_noise_mg_variable_lacunarity().
| float BLI_noise_generic_noise | ( | float | noisesize, |
| float | x, | ||
| float | y, | ||
| float | z, | ||
| bool | hard, | ||
| int | noisebasis | ||
| ) |
newnoise: generic noise function for use with different noisebasis.
Definition at line 1172 of file noise.c.
References BLI_cellNoiseU(), fabsf, float(), newPerlinU(), orgBlenderNoise(), orgPerlinNoiseU(), voronoi_Cr(), voronoi_F1(), voronoi_F1F2(), voronoi_F2(), voronoi_F3(), voronoi_F4(), x, y, and z.
Referenced by M_Noise_noise(), noise_vector(), stucci(), turb(), and wood_int().
| float BLI_noise_generic_turbulence | ( | float | noisesize, |
| float | x, | ||
| float | y, | ||
| float | z, | ||
| int | oct, | ||
| bool | hard, | ||
| int | noisebasis | ||
| ) |
Definition at line 1230 of file noise.c.
References BLI_cellNoiseU(), fabsf, float(), newPerlinU(), orgBlenderNoise(), orgPerlinNoiseU(), sum(), t, voronoi_Cr(), voronoi_F1(), voronoi_F1F2(), voronoi_F2(), voronoi_F3(), voronoi_F4(), x, y, and z.
Referenced by alter_co(), clouds(), do_physical_effector(), do_rough(), do_rough_curve(), marble_int(), and pointdensity().
Definition at line 439 of file noise.c.
References orgBlenderNoise(), x, y, and z.
Referenced by BLI_noise_turbulence().
| float BLI_noise_mg_fbm | ( | float | x, |
| float | y, | ||
| float | z, | ||
| float | H, | ||
| float | lacunarity, | ||
| float | octaves, | ||
| int | noisebasis | ||
| ) |
Definition at line 1305 of file noise.c.
References BLI_noise_cell(), float(), floorf, H, newPerlin(), orgBlenderNoiseS(), orgPerlinNoise(), powf, voronoi_CrS(), voronoi_F1F2S(), voronoi_F1S(), voronoi_F2S(), voronoi_F3S(), voronoi_F4S(), x, y, and z.
Referenced by M_Noise_fractal(), and mg_mFractalOrfBmTex().
| float BLI_noise_mg_hetero_terrain | ( | float | x, |
| float | y, | ||
| float | z, | ||
| float | H, | ||
| float | lacunarity, | ||
| float | octaves, | ||
| float | offset, | ||
| int | noisebasis | ||
| ) |
Definition at line 1442 of file noise.c.
References BLI_noise_cell(), float(), floorf, H, newPerlin(), orgBlenderNoiseS(), orgPerlinNoise(), powf, voronoi_CrS(), voronoi_F1F2S(), voronoi_F1S(), voronoi_F2S(), voronoi_F3S(), voronoi_F4S(), x, y, and z.
Referenced by M_Noise_hetero_terrain(), and mg_HTerrainTex().
| float BLI_noise_mg_hybrid_multi_fractal | ( | float | x, |
| float | y, | ||
| float | z, | ||
| float | H, | ||
| float | lacunarity, | ||
| float | octaves, | ||
| float | offset, | ||
| float | gain, | ||
| int | noisebasis | ||
| ) |
Definition at line 1519 of file noise.c.
References BLI_noise_cell(), float(), floorf, H, newPerlin(), orgBlenderNoiseS(), orgPerlinNoise(), powf, result, voronoi_CrS(), voronoi_F1F2S(), voronoi_F1S(), voronoi_F2S(), voronoi_F3S(), voronoi_F4S(), x, y, and z.
Referenced by M_Noise_hybrid_multi_fractal(), and mg_ridgedOrHybridMFTex().
| float BLI_noise_mg_multi_fractal | ( | float | x, |
| float | y, | ||
| float | z, | ||
| float | H, | ||
| float | lacunarity, | ||
| float | octaves, | ||
| int | noisebasis | ||
| ) |
Definition at line 1376 of file noise.c.
References BLI_noise_cell(), float(), floorf, H, newPerlin(), orgBlenderNoiseS(), orgPerlinNoise(), powf, voronoi_CrS(), voronoi_F1F2S(), voronoi_F1S(), voronoi_F2S(), voronoi_F3S(), voronoi_F4S(), x, y, and z.
Referenced by M_Noise_multi_fractal(), and mg_mFractalOrfBmTex().
| float BLI_noise_mg_ridged_multi_fractal | ( | float | x, |
| float | y, | ||
| float | z, | ||
| float | H, | ||
| float | lacunarity, | ||
| float | octaves, | ||
| float | offset, | ||
| float | gain, | ||
| int | noisebasis | ||
| ) |
Definition at line 1603 of file noise.c.
References BLI_noise_cell(), fabsf, float(), H, newPerlin(), orgBlenderNoiseS(), orgPerlinNoise(), powf, result, voronoi_CrS(), voronoi_F1F2S(), voronoi_F1S(), voronoi_F2S(), voronoi_F3S(), voronoi_F4S(), x, y, and z.
Referenced by M_Noise_ridged_multi_fractal(), and mg_ridgedOrHybridMFTex().
| float BLI_noise_mg_variable_lacunarity | ( | float | x, |
| float | y, | ||
| float | z, | ||
| float | distortion, | ||
| int | nbas1, | ||
| int | nbas2 | ||
| ) |
Definition at line 1677 of file noise.c.
References BLI_noise_cell(), float(), newPerlin(), orgBlenderNoiseS(), orgPerlinNoise(), voronoi_CrS(), voronoi_F1F2S(), voronoi_F1S(), voronoi_F2S(), voronoi_F3S(), voronoi_F4S(), x, y, and z.
Referenced by M_Noise_variable_lacunarity(), and mg_distNoiseTex().
Definition at line 451 of file noise.c.
References BLI_noise_hnoise(), x, y, and z.
Referenced by fcm_noise_evaluate().
Definition at line 931 of file noise.c.
References dist_Chebychev(), dist_Manhattan(), dist_Minkovsky(), dist_Minkovsky4(), dist_MinkovskyH(), dist_Real(), dist_Squared(), float(), floor(), HASHPNT, x, y, and z.
Referenced by do_clump(), M_Noise_voronoi(), voronoi_F1(), voronoi_F1F2(), voronoi_F1F2S(), voronoi_F1S(), voronoi_F2(), voronoi_F2S(), voronoi_F3(), voronoi_F3S(), voronoi_F4(), voronoi_F4S(), and voronoiTex().
| BLI_INLINE float grad | ( | int | hash_val, |
| float | x, | ||
| float | y, | ||
| float | z | ||
| ) |
Definition at line 286 of file noise.c.
Referenced by adjustSwingAxisToUseEllipseNormal(), newPerlin(), and btSdfCollisionShape::queryPoint().
| BLI_INLINE float lerp | ( | float | t, |
| float | a, | ||
| float | b | ||
| ) |
Definition at line 276 of file noise.c.
References Freestyle::a, and t.
Referenced by newPerlin(), and noise3_perlin().
Definition at line 295 of file noise.c.
References A, B, floor(), grad(), hash, lerp(), npfade(), v, w(), x, X, Y, y, Z, and z.
Referenced by BLI_noise_mg_fbm(), BLI_noise_mg_hetero_terrain(), BLI_noise_mg_hybrid_multi_fractal(), BLI_noise_mg_multi_fractal(), BLI_noise_mg_ridged_multi_fractal(), BLI_noise_mg_variable_lacunarity(), and newPerlinU().
Definition at line 332 of file noise.c.
References newPerlin(), x, y, and z.
Referenced by BLI_noise_generic_noise(), and BLI_noise_generic_turbulence().
Definition at line 776 of file noise.c.
References Freestyle::a, Freestyle::c, float(), g_perlin_data_ub, g_perlin_data_v3, lerp(), SETUP, SURVE, t, v, and VALUE_AT.
Referenced by BLI_noise_hnoisep(), orgPerlinNoise(), and orgPerlinNoiseU().
| BLI_INLINE float npfade | ( | float | t | ) |
Definition at line 344 of file noise.c.
References floor(), hash, hashvectf, x, y, and z.
Referenced by BLI_noise_generic_noise(), BLI_noise_generic_turbulence(), BLI_noise_hnoise(), and orgBlenderNoiseS().
Definition at line 433 of file noise.c.
References orgBlenderNoise(), x, y, and z.
Referenced by BLI_noise_mg_fbm(), BLI_noise_mg_hetero_terrain(), BLI_noise_mg_hybrid_multi_fractal(), BLI_noise_mg_multi_fractal(), BLI_noise_mg_ridged_multi_fractal(), and BLI_noise_mg_variable_lacunarity().
Definition at line 840 of file noise.c.
References noise3_perlin(), v, x, y, and z.
Referenced by BLI_noise_mg_fbm(), BLI_noise_mg_hetero_terrain(), BLI_noise_mg_hybrid_multi_fractal(), BLI_noise_mg_multi_fractal(), BLI_noise_mg_ridged_multi_fractal(), and BLI_noise_mg_variable_lacunarity().
Definition at line 847 of file noise.c.
References noise3_perlin(), v, x, y, and z.
Referenced by BLI_noise_generic_noise(), and BLI_noise_generic_turbulence().
Definition at line 1061 of file noise.c.
References t, voronoi_F1F2(), x, y, and z.
Referenced by BLI_noise_generic_noise(), and BLI_noise_generic_turbulence().
Definition at line 1109 of file noise.c.
References t, voronoi_F1F2(), x, y, and z.
Referenced by BLI_noise_mg_fbm(), BLI_noise_mg_hetero_terrain(), BLI_noise_mg_hybrid_multi_fractal(), BLI_noise_mg_multi_fractal(), BLI_noise_mg_ridged_multi_fractal(), and BLI_noise_mg_variable_lacunarity().
Definition at line 1025 of file noise.c.
References BLI_noise_voronoi(), x, y, and z.
Referenced by BLI_noise_generic_noise(), and BLI_noise_generic_turbulence().
Definition at line 1053 of file noise.c.
References BLI_noise_voronoi(), x, y, and z.
Referenced by BLI_noise_generic_noise(), BLI_noise_generic_turbulence(), voronoi_Cr(), and voronoi_CrS().
Definition at line 1101 of file noise.c.
References BLI_noise_voronoi(), x, y, and z.
Referenced by BLI_noise_mg_fbm(), BLI_noise_mg_hetero_terrain(), BLI_noise_mg_hybrid_multi_fractal(), BLI_noise_mg_multi_fractal(), BLI_noise_mg_ridged_multi_fractal(), and BLI_noise_mg_variable_lacunarity().
Definition at line 1073 of file noise.c.
References BLI_noise_voronoi(), x, y, and z.
Referenced by BLI_noise_mg_fbm(), BLI_noise_mg_hetero_terrain(), BLI_noise_mg_hybrid_multi_fractal(), BLI_noise_mg_multi_fractal(), BLI_noise_mg_ridged_multi_fractal(), and BLI_noise_mg_variable_lacunarity().
Definition at line 1032 of file noise.c.
References BLI_noise_voronoi(), x, y, and z.
Referenced by BLI_noise_generic_noise(), and BLI_noise_generic_turbulence().
Definition at line 1080 of file noise.c.
References BLI_noise_voronoi(), x, y, and z.
Referenced by BLI_noise_mg_fbm(), BLI_noise_mg_hetero_terrain(), BLI_noise_mg_hybrid_multi_fractal(), BLI_noise_mg_multi_fractal(), BLI_noise_mg_ridged_multi_fractal(), and BLI_noise_mg_variable_lacunarity().
Definition at line 1039 of file noise.c.
References BLI_noise_voronoi(), x, y, and z.
Referenced by BLI_noise_generic_noise(), and BLI_noise_generic_turbulence().
Definition at line 1087 of file noise.c.
References BLI_noise_voronoi(), x, y, and z.
Referenced by BLI_noise_mg_fbm(), BLI_noise_mg_hetero_terrain(), BLI_noise_mg_hybrid_multi_fractal(), BLI_noise_mg_multi_fractal(), BLI_noise_mg_ridged_multi_fractal(), and BLI_noise_mg_variable_lacunarity().
Definition at line 1046 of file noise.c.
References BLI_noise_voronoi(), x, y, and z.
Referenced by BLI_noise_generic_noise(), and BLI_noise_generic_turbulence().
Definition at line 1094 of file noise.c.
References BLI_noise_voronoi(), x, y, and z.
Referenced by BLI_noise_mg_fbm(), BLI_noise_mg_hetero_terrain(), BLI_noise_mg_hybrid_multi_fractal(), BLI_noise_mg_multi_fractal(), BLI_noise_mg_ridged_multi_fractal(), and BLI_noise_mg_variable_lacunarity().
|
static |
Definition at line 470 of file noise.c.
Referenced by noise3_perlin().
|
static |
Definition at line 506 of file noise.c.
Referenced by noise3_perlin().
|
static |
Definition at line 171 of file noise.c.
Referenced by orgBlenderNoise().