mx_fractal_noise_vec2
A procedural 2D fractal noise generator that specializes in creating directional two-dimensional vector fields, ideal for implementing distortion and flow effects.
Core Advantages
Directly outputs a `vec2` vector, perfectly matching applications that require directional input like UV coordinate distortion, thus avoiding the cumbersome and inefficient process of manually combining two separate noises.
Common Uses
Simulating underwater refraction or heat haze by distorting UV coordinates
Creating procedural flow maps to drive particle or water surface movement
Generating two-channel textures to control different material properties like roughness and metalness
How to adjust
Directly control the overall intensity of the distortion by adjusting the `amplitude` parameter. "Sculpt" the shape of the distortion by tuning `octaves`, `lacunarity`, and `diminish`. For instance, increasing `octaves` adds more detail to the distortion, while decreasing `diminish` makes the effect smoother and softer.
Code Examples
1// Generate a 2D noise vector for UV distortion, controlling its strength with amplitude
2const distortion = mx_fractal_noise_vec2( vec3(uv(), timerLocal()), 4, 2.0, 0.5, 0.1 );
3
4// Add this vector to the original UV coordinates
5const distortedUV = uv().add( distortion );