exp2
Calculates 2 to the power of x (2^x), ideal for simulating photographic exposure stops and calculating 'octaves' in procedural noise.
Core Advantages
Provides an intuitive exponential control scheme that aligns with binary concepts. Each integer increment to its input doubles the output, perfectly modeling concepts like 'exposure stops' or 'frequency doubling' in an intuitive way.
Common Uses
Simulating photographic exposure 'stops'
Calculating octaves in procedural noise
Calculating Level of Detail (LOD) scale factors
How to adjust
Control the output by adjusting the single input parameter `x`. Each time `x` is incremented by 1, the output doubles; each time it's decremented by 1, the output is halved. This offers an intuitive, non-linear control scheme for properties like brightness or frequency.
Code Examples
1// Convert 'exposure stops' to a brightness multiplier
2// stops=1 -> brightness x2, stops=-1 -> brightness x0.5
3const exposureMultiplier = exp2( exposureStops );