โ† All examples

godot shaders

Rain on a window with running drops

Window pane covered in rain: static droplets of random size scattered in cells, drops that run down with trails, each drop refracting a sharp upside-down view while the glass between them shows a blurred, misted scene.

Recorded render of Rain on a window with running drops

What this component contains

  • ATTRIBUTION.md
  • LICENSE
  • README.md
  • component.json
  • demo.tscn
  • inspect_shader.py
  • material.tres
  • preview.png
  • rain_glass_droplets.gdshader
  • test_package.py
  • verification/native.json

How it works

Shader type
spatial
Render modes
unshaded, cull_disabled, depth_draw_never, shadows_disabled
Parameters
screen_texture (sampler2D), drop_density (float = 12), drop_size (float = 0.28), runner_columns (float = 7), runner_speed (float = 0.35), refraction (float = 0.06), mist_blur (float = 3), mist_tint (vec4 = 0.82, 0.87, 0.92, 1) and 1 more
Use it on
A quad (the pane) in front of the scene, with UV v pointing down the glass.
Result
A misty pane with clear beads of water showing sharp, bent bits of the scene, and drops sliding down.
Renderers
compatibility: compiled and rendered, forward plus: not verified, mobile: not verified
Placement
res://baltor/godot_shaders/rain_glass_droplets/

Recorded checks

godot 4.7.2.stable.official.ed1daf0bf

  • contract_static
  • engine_run
  • engine_log_clean
  • shader_in_scene
  • capture_written
  • render_not_uniform
  • shader_changes_pixels

Limits to consider

Screen-space refraction cannot show what is off screen and does not invert the view like a real lens. Drops do not merge or interact; runners can pass through static drops. The mist blur depends on the screen texture's mipmaps.