mx_fractal_noise_vec3
A procedural 3D fractal noise generator that creates complex, detail-rich `vec3` vectors by layering multiple noises, ideal for directly generating procedural color textures or 3D vertex displacement.
Core Advantages
Directly outputs a `vec3` vector containing rich, multi-layered details, greatly simplifying the process of creating realistic procedural color textures (like marble) and 3D geometric deformations (like rugged terrain).
Common Uses
Generating procedural color textures (e.g., marble, wood grain)
Creating irregular shapes via 3D vertex displacement (e.g., asteroids, rocks)
Simulating volumetric effects (e.g., nebulas, colorful smoke)
How to adjust
Control the overall size and density of the pattern by scaling the `position` input (e.g., `positionWorld.mul(4.0)`). Sculpt the internal details by adjusting `octaves`, `lacunarity`, and `diminish`. When used for vertex displacement, the `amplitude` parameter is the most direct way to control the deformation intensity.
Code Examples
1// Generate 3D fractal noise, usable directly as color or 3D displacement
2const fractalVec3 = mx_fractal_noise_vec3(
3 positionWorld.mul(0.5), // Sample position
4 int( 5 ), // octaves: Level of detail
5 float( 2.2 ), // lacunarity: Frequency growth rate
6 float( 0.4 ) // diminish: Amplitude decay rate
7);