โ† All examples

procedural textures

Iridescent oil slick from thin-film interference

Generate tileable maps of thin-film interference colours: oil on puddles in asphalt, a spill on harbour water, a soap film or heat tint on steel, with colours computed from film thickness, refractive indices and colour-matching functions. Use for wet streets, polluted water, bubbles and welded metal.

Recorded render of Iridescent oil slick from thin-film interference

What this component contains

  • ATTRIBUTION.md
  • LICENSE
  • README.md
  • blender_material.py
  • component.json
  • material.tres
  • oil_slick_iridescent.py
  • pngio.py
  • preview.png
  • test_package.py
  • texkit.py
  • verification/native.json

How it works

Entry point
generate
Maps
albedo, normal, roughness, metallic, height, ao
Parameters
pattern, film_min, film_max, scale, swirl, coverage, vividness, hue_shift and 2 more
Presets
default, harbour_water, soap_film, tempered_steel
Tileable
yes
Command line
python oil_slick_iridescent.py --size 1024 --seed 7 --preset NAME --out DIR [--width W --height H] [--set NAME=VALUE] [--directx-normal] [--orm]
Godot material
material.tres
Blender builder
blender_material.build_material(folder)

Recorded checks

godot 4.7.2.stable.official.ed1daf0bf

  • command_line_generates_declared_maps
  • maps_decode
  • maps_have_declared_size_and_channels
  • maps_tile_without_a_seam
  • normal_vectors_unit_length_facing_out
  • maps_carry_detail
  • godot_imports_the_maps
  • godot_material_template_loads_every_map
  • godot_compatibility_render
  • capture_shows_the_textured_surface
  • blender_builds_the_material

Limits to consider

Two-beam interference at normal incidence: colours do not shift with viewing angle, multiple reflections and absorption are ignored, and a metal substrate is approximated by a negative real reflection amplitude instead of a complex index, so temper colours are close but not exact. The colour-matching functions are an analytic Gaussian fit and the grey part of the film reflectance is partly removed for clearer hues, so this is a stylized rendering of thin-film colour rather than a spectral measurement. Film thickness comes from noise or bands, not from flow or oxidation physics. One still frame.