mx_fractal_noise_vec4
A procedural 4D fractal noise generator that creates a `vec4` vector with four independent channels (RGBA) in a single call, designed for colorful effects with transparency.
Core Advantages
Directly outputs a `vec4` vector usable for RGBA color, greatly simplifying the creation of procedural volumetric effects (like smoke and fire), and can also serve as an efficient data-packing tool to drive multiple material properties with one node.
Common Uses
Creating procedural volumetric effects with transparency (smoke, nebulas)
Making dynamic, semi-transparent energy shields or flowing lava
Packing multiple material properties like roughness and metalness into one node
How to adjust
All parameters affect the color (RGB) and alpha (A) channels simultaneously. A powerful adjustment technique is to post-process the output alpha channel (`.a`) separately (e.g., using `pow()` to increase contrast) to independently control the sharpness of the effect's edges. To make transparency visible, you must set `transparent={true}` on the material.
Code Examples
1// Post-process the output alpha channel for sharper edges
2const noise = mx_fractal_noise_vec4( ... );
3const highContrastAlpha = noise.a.mul(0.5).add(0.5).pow(4.0);
4const finalRgba = vec4(noise.rgb, highContrastAlpha);