sqrt
Provides the fundamental mathematical square root function (`sqrt(x)`). It is used for calculations involving distance and for transforming linear data into non-linear, visually appealing curves.
Core Advantages
Its primary value is creating non-linear mappings. The `sqrt` curve transforms linear gradients or values (in the 0 to 1 range) into smooth, natural-looking falloffs with a distinct 'ease-out' characteristic, which is visually softer than a harsh linear transition.
Common Uses
Creating soft radial gradients and falloffs by reshaping a linear distance value
Calculating physically accurate distances for custom lighting attenuation models
Adjusting color values, often to brighten mid-tones and shadows, approximating a gamma correction
How to adjust
You adjust this node by changing its single input (`x`). Applying it to a linear gradient (e.g., `uv().x`) remaps the output to a smooth 'ease-out' curve. Applying it to a color will brighten the texture, with a stronger effect on darker and mid-range tones.
Code Examples
1
2// Calculate linear distance from the center
3const distNode = distance(uv(), vec2(0.5));
4
5// Apply square root to create a non-linear, soft falloff
6const curvedFalloff = sqrt(distNode);
7