Iridescence
Iridescence is the rainbow shimmer seen on bubbles, oil films, and beetle wings — color that changes with viewing angle rather than light direction. Genesis approximates it with a 1D ramp sampled by the Fresnel term, so the entire color cycle comes from a single texture.
View-angle rainbow shift on an oil-slick surface as the camera orbits.
When to use it
- Oil slicks and soap bubbles — a full saturated rainbow.
- Sci-fi armor — a subtle violet-to-cyan shift under specular.
- Beetle shells and jewellery — high-saturation iridescent metals.
- Stylized water highlights — colorful caustic flicker.
Difference from Hue Shift
How it works
The shader computes 1 - dot(N, V), raises it to _IridescencePower, and uses the result as the X coordinate into _IridescenceRamp. The sampled color is blended over the surface by _IridescenceIntensity. An optional mask restricts the effect to specific UV regions.
A plain metal surface against the same one with iridescence. Drag to compare.
Properties
Usage
- Author a ramp in the Ramp Creator. The classic oil-slick ramp runs magenta to cyan to yellow to magenta.
- Assign it and set Intensity to 0.3–0.5 for subtle, 1.0+ for full chroma.
- Use Power to control where the rainbow appears — 1 covers the whole surface, 5+ only the grazing edges.
- Animate Phase Shift from a script for a moving shimmer.
material.SetTexture("_IridescenceRamp", oilSlickRamp);
material.SetFloat("_IridescenceIntensity", 0.4f);
material.SetFloat("_IridescenceShift", Mathf.Repeat(Time.time * 0.2f, 1f));Tips & gotchas
- Use bilinear filtering with clamp wrap on the ramp to avoid hue seams at the edges.
- Subtle reads better — 0.2–0.5 intensity is usually plenty; full strength looks like a bug.
- Pairs with Specular: the rainbow tints the spec lobe naturally in Add or Overlay blend.
- Cost is a single texture sample plus a lerp, so it is negligible on mobile.
Related
- Ramp Creator — author iridescence ramps in-editor.
- Hue Shift — time-based hue rotation.
- Specular Highlights — pair for iridescent metal.
- MatCap — an alternate way to fake complex highlights.
Last updated on