exp
Calculates the natural exponential e to the power of x (e^x), fundamental for creating non-linear effects like physically plausible falloffs, glows, and fog.
Core Advantages
Easily transforms a linear input (like distance) into a natural exponential curve, perfectly simulating physical phenomena like light attenuation and atmospheric density, thus avoiding the artificial look of linear transitions.
Common Uses
Simulating atmospheric fog
Creating glows and bloom effects
Coloring heightmaps
HDR Tone Mapping
How to adjust
The effect is primarily controlled by scaling its input value. When creating falloff effects (e.g., `exp(-distance * factor)`), increasing the `factor` makes the decay curve steeper, resulting in a tighter, sharper glow or fog. Decreasing the `factor` flattens the curve, creating a wider, softer effect.
Code Examples
1// Create a glow that falls off exponentially from the center
2// A larger negative value makes the glow tighter and sharper
3const glow = exp( distance.mul( -5.0 ) );