โ† All examples

godot shaders

Fake volumetric light cone with dust

Additive spotlight beam on an open cone mesh: soft edges from the facing ratio, brightness falling off along the beam, drifting dust specks, and a soft fade where the cone meets geometry using the depth buffer.

Recorded render of Fake volumetric light cone with dust

What this component contains

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

How it works

Shader type
spatial
Render modes
unshaded, blend_add, cull_disabled, depth_draw_never, shadows_disabled
Parameters
depth_texture (sampler2D), beam_color (vec4 = 1, 0.92, 0.7, 1), intensity (float = 0.9), edge_softness (float = 2.5), length_falloff (float = 1.4), dust_amount (float = 0.5), dust_scale (float = 60), dust_speed (float = 0.05) and 1 more
Use it on
An open cone mesh (a CylinderMesh with a small top radius and no caps) with V running from the apex., Optional: a SpotLight3D with the same aim to light the scene.
Result
A warm, soft-edged shaft of light with floating dust that fades where it reaches the floor and statue.
Renderers
compatibility: compiled and rendered, forward plus: not verified, mobile: not verified
Placement
res://baltor/godot_shaders/light_shaft_cone/

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

Not a light: it does not illuminate anything. It ignores occluders inside the cone (no shadowed shafts). Additive, so it is invisible on bright backgrounds. Seen from inside the cone it looks flat.