unpremult
Converts a color from Premultiplied Alpha format back to the standard Straight (non-premultiplied) Alpha format to ensure accuracy in subsequent color processing and calculations.
Core Advantages
By restoring color to its original, non-premultiplied state, it ensures that subsequent operations like color correction, lighting, or filters are performed on pure color information, thus avoiding color distortion and guaranteeing physically correct results.
Common Uses
Processing imported premultiplied alpha textures to avoid unnatural dark fringes during blending
In multi-pass compositing (e.g., bloom), restoring original color before applying color correction
Rendering transparent materials for models that use a premultiplied alpha standard, like glTF
How to adjust
This node has no adjustable parameters. Its output is determined entirely by the input color's alpha value: the lower the alpha, the more the output RGB is brightened to recover its original color value.
Code Examples
1// Assuming premultipliedColorNode is a vec4 color in premultiplied alpha
2// (its RGB values have been multiplied by its alpha)
3const straightAlphaColor = TSL.unpremult(premultipliedColorNode);