โ† All examples

godot shaders

Lava lamp metaballs

Soft blobs that merge and split like a lava lamp: several metaballs follow Lissajous paths, their summed inverse-square field is thresholded into shapes, shaded by the field gradient and given a glowing rim.

Recorded render of Lava lamp metaballs

What this component contains

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

How it works

Shader type
canvas_item
Parameters
blob_color (vec4 = 1, 0.35, 0.25, 1), highlight_color (vec4 = 1, 0.85, 0.45, 1), background_top (vec4 = 0.2, 0.05, 0.3, 1), background_bottom (vec4 = 0.45, 0.08, 0.25, 1), blob_count (int = 7), blob_size (float = 0.06), threshold (float = 1), speed (float = 0.4) and 1 more
Use it on
A ColorRect (or any CanvasItem) sized to the area to fill; UVs span 0 to 1 across it.
Result
Orange blobs with yellow highlights flowing and merging over a purple gradient.
Renderers
compatibility: compiled and rendered, forward plus: not verified, mobile: not verified
Placement
res://baltor/godot_shaders/metaball_blobs_2d/

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

Cost grows with blob count times three field evaluations per pixel. Blobs are 2D: no occlusion or depth.