Skip to main content

blendColorBurn: Dramatic Shadow Enhancement

Mathematical Foundation of Color Burn

Color burn creates dramatic darkening effects by inverting the blend color and dividing the base by the inverted blend. This mathematical approach intensifies shadows while preserving highlights, creating high-contrast artistic effects.

The mathematical definition is:

Cresult={0if Cblend=0max(0,11CbaseCblend)otherwiseC_{result} = \begin{cases} 0 & \text{if } C_{blend} = 0 \\ \max\left(0, 1 - \frac{1 - C_{base}}{C_{blend}}\right) & \text{otherwise} \end{cases}

The division operation creates non-linear darkening that becomes more pronounced as blend values approach zero, generating deep shadow regions with preserved detail.

Shadow Enhancement Properties

PropertyDescriptionVisual Effect
Shadow AmplificationDark areas become dramatically darkerDeep, rich shadows
Highlight PreservationBright areas maintain luminositySelective darkening
Contrast EnhancementIncreases overall dynamic rangeDramatic tonal separation
Zero ProtectionPrevents division by zeroStable computation
Live Editor
const fragment = () => {
      const center = vec2(0.5)
      const angle = uv.y.sub(center.y).atan2(uv.x.sub(center.x))
      const radius = uv.sub(center).length()
      const base = vec3(
              radius.mul(20).sin().mul(0.3).add(0.7),
              angle.mul(3).cos().mul(0.2).add(0.6),
              radius.mul(1.5)
      )
      const burn = vec3(
              float(0.2).smoothstep(0.8, uv.x),
              float(0.1).smoothstep(0.9, uv.y),
              uv.x.add(uv.y).mul(8).sin().mul(0.3).add(0.4)
      )
      const result = blendColorBurnVec3(base, burn)
      return vec4(result, 1)
}