โ† All examples

godot shaders

Force field with glowing contact lines

Additive energy shield that brightens at its silhouette, carries moving bands, and glows where it cuts through other geometry, found by comparing its depth with the scene depth buffer.

Recorded render of Force field with glowing contact lines

What this component contains

  • ATTRIBUTION.md
  • LICENSE
  • README.md
  • component.json
  • demo.tscn
  • force_field_intersection.gdshader
  • inspect_shader.py
  • 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), field_color (vec4 = 0.3, 0.7, 1, 1), base_strength (float = 0.06), rim_power (float = 3), rim_strength (float = 1.1), contact_width (float = 0.18), contact_strength (float = 2.5), band_frequency (float = 14) and 2 more
Use it on
Opaque geometry intersecting the shield; transparent objects are not in the depth buffer.
Result
A faint blue bubble with a bright outline, moving bands and bright lines where it cuts the floor and objects.
Renderers
compatibility: compiled and rendered, forward plus: not verified, mobile: not verified
Placement
res://baltor/godot_shaders/force_field_intersection/

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

The contact test compares depths along the view ray, so the glow band widens where the shield meets a surface at a shallow angle. Additive blending cannot darken. Depth reconstruction uses the CURRENT_RENDERER define to pick the depth range convention; only the Compatibility path ran.