iridescence
The `iridescence` node is used in `MeshPhysicalMaterial` to simulate the thin-film interference effect, recreating the rainbow-like sheen on surfaces like soap bubbles, which changes with the viewing angle.
Core Advantages
Integrates the complex physical phenomenon of iridescence into shaders in a simple, declarative way. It acts as a read-only property node in TSL, directly linking to the material's iridescence parameters, greatly enhancing the realism and visual appeal of specific materials.
Common Uses
Soap Bubbles & Oil Slicks
Pearlescent Car Paint
Insect Shells & Mother-of-Pearl
How to adjust
The iridescence effect is adjusted entirely by modifying `MeshPhysicalNodeMaterial` properties in JavaScript. `material.iridescence` controls the overall strength, `material.iridescenceIOR` affects reflection intensity and color, and changing the `material.iridescenceThickness` range completely alters the resulting color spectrum.
Code Examples
1// Set iridescence parameters in JS; the TSL node reads them automatically
2// Strength: 0 = off, 1 = full effect
3material.iridescence = 1.0;
4
5// The film's index of refraction
6material.iridescenceIOR = 1.3;
7
8// The film's thickness range (in nm), which determines the colors
9material.iridescenceThickness = uniform(new THREE.Vector2(100, 400));