Baltor Get started

Gallery / Godot shaders

Force field with glowing contact lines

In your harnessGodot shaderMIT

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.

Render of Force field with glowing contact lines
The render its check recorded in Godot 4.7.2, 256 by 256 pixels.

What it takes and gives

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/

Limits. 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.

Details

Kind
Godot shader
Engine
Godot 4.3 or later
Files
11 files, 67.3 KB
Licence
MIT
Declared effects
reads files, runs commands
Checked with
Godot 4.7.2, opengl3 compatibility (Mesa llvmpipe, Xvfb)
Checks
contract static, engine run, engine log clean, shader in scene, capture written, render not uniform, shader changes pixels
Techniques
Scene depth reconstruction with INV_PROJECTION_MATRIX, Depth difference intersection glow, Facing ratio rim with scrolling sine bands
Tags
godot shader, spatial, force field, shield, depth intersection, sci-fi, additive
Identity
library.supply.creative_originals.4ca854f8e777a40dc6362eed.d73762175a63a6eb
Version
d73762175a63a6eb391e139f3ef9b18a2bedf524b7f940cb925fd7c5dd3cd14a

The version is the SHA-256 of the item your harness downloads; every file in it names its own checksum.

Something wrong with this item, its rights or its safety? Report it on the support page, or from your harness after a download.