Baltor Get started

Gallery / Godot shaders

Thin-film interference iridescence

In your harnessGodot shaderMIT

Iridescent colours of soap bubbles and oil films from a two-beam thin-film interference estimate per colour channel, with film thickness swirled by noise so the colours drift.

Render of Thin-film interference iridescence
The render its check recorded in Godot 4.7.2, 256 by 256 pixels.

What it takes and gives

Shader type
spatial
Render modes
cull_back, depth_draw_always
Parameters
film_index (float = 1.33), thickness_min_nm (float = 250), thickness_max_nm (float = 750), swirl_scale (float = 2), swirl_speed (float = 0.15), opacity (float = 0.35), roughness (float = 0.05), base_color (vec4 = 0.02, 0.02, 0.03, 1)
Result
A clear bubble whose reflections shimmer in bands of magenta, green and gold that drift.
Renderers
compatibility: compiled and rendered, forward plus: not verified, mobile: not verified
Placement
res://baltor/godot_shaders/thin_film_iridescence/

Limits. Two-beam approximation at three wavelengths, not a spectral integration: colours are plausible, not exact. Multiple reflections inside the film are ignored. Transparency uses Godot's alpha blending and is not sorted per pixel.

Details

Kind
Godot shader
Engine
Godot 4.3 or later
Files
11 files, 79.3 KB
Licence
MIT
Declared effects
reads files, runs commands
Checked with
Godot 4.7.2, opengl3 compatibility (Mesa llvmpipe, Xvfb)
Checks
contract static, engine run, engine log clean, shader in scene, capture written, render not uniform, shader changes pixels
Techniques
Thin-film interference from the optical path difference 2 n d cos(theta), Per-channel wavelength evaluation, Value noise with quintic interpolation and fractional Brownian motion in 3D
Tags
godot shader, spatial, iridescence, thin film, soap bubble, interference, oil slick
Identity
library.supply.creative_originals.bc0aba1b194e04e7610390b3.84c51e3b379f9ac8
Version
84c51e3b379f9ac85fde94289366641ef65cbbeb95081e21b225f9cf59635ad1

The version is the SHA-256 of the item your harness downloads; every file in it names its own checksum.

Something wrong with this item, its rights or its safety? Report it on the support page, or from your harness after a download.