โ† All examples

procedural textures

Rain on glass: droplets, running trails and mist

Generate tileable maps of rain on a window: droplets in three size classes as merging domes, running drops that leave meandering trails and beads, and condensation mist wiped clear by them, with an alpha overlay and a normal map for refraction. Use for windows, windscreens, visors and wet camera lenses.

Recorded render of Rain on glass: droplets, running trails and mist

What this component contains

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

How it works

Entry point
generate
Maps
albedo, normal, roughness, height, ao
Parameters
drops, drop_size, trails, beading, mist, relief, hue_shift, saturation and 1 more
Presets
default, drizzle, downpour, misted
Tileable
yes
Command line
python rain_on_glass.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

A still frame: drops do not move, and trails run down the tile and wrap around it, so a repeating tile repeats its trails. Drops are domes of a fixed profile merged by taking the higher one, not a fluid simulation, and the lighting painted into the albedo assumes light from the upper left. Refraction needs a glass shader that offsets the background by the normal map; the albedo alone only darkens rims and lights one side. Drops smaller than half a pixel are drawn at that size with less height.