blendExclusion: Soft Contrast Inversion
Mathematical Foundation of Exclusion
Exclusion blending creates a softer version of difference blending by using the formula base + blend - 2 * base * blend
. This produces inverted contrast effects while preserving mid-tones, creating subtle yet distinctive visual results.
The mathematical definition is:
Unlike harsh difference blending, exclusion maintains smoother transitions and creates more pleasing artistic effects by reducing contrast in overlapping areas.
Soft Contrast Properties
Property | Description | Mathematical Behavior |
---|---|---|
Mid-tone Preservation | Gray areas remain relatively unchanged | |
Soft Inversion | Gentle contrast without harsh edges | Smooth gradient response |
Symmetry | Order independence | |
Bounded Output | Results stay within valid range |
Live Editor
const fragment = () => { const base = vec3(0.7, 0.4, 0.8) const wave1 = uv.x.mul(8).add(uv.y.mul(3)).sin().mul(0.3).add(0.5) const wave2 = uv.y.mul(6).add(uv.x.mul(4)).cos().mul(0.3).add(0.5) const blend = vec3(wave1, wave2, wave1.mul(wave2)) const result = blendExclusionVec3(base, blend) return vec4(result, 1) }