Intersection Glow
Intersection Glow highlights the contact line between a transparent mesh and the opaque world behind it — the classic force-field-bubble effect. Genesis samples the depth buffer and lights up pixels whose depth is close to the geometry beneath them.
A bright contact line tracking where the force-field bubble meets the world.
When to use it
- Force-field bubbles around characters or buildings.
- Water surfaces — a bright foam line where water meets shore or props.
- Magic barriers — a bright contact glow where the wall meets the ground.
- Bullet impacts — a short-lived intersection between a sphere and the hit surface.
Difference from Rim Lighting
How it works
The shader samples _CameraDepthTexture, computes linearSceneDepth - linearSurfaceDepth, and remaps it into a 0–1 weight via pow(1 - depthDelta / _IntersectionWidth, _IntersectionPower). The result is multiplied by _IntersectionColor * _IntersectionIntensity and added to the lit output.
A plain transparent hull against one with intersection glow. Drag to compare.
Properties
Usage
- Enable Depth Texture on the URP Asset (required).
- Switch the material to Transparent.
- Enable Intersection Glow and pick a color. HDR intensities of 2–6 sell the effect through Bloom.
- Add a scrolling noise texture for energy flowing along the edge.
material.SetColor("_IntersectionColor", new Color(0.3f, 1.0f, 1.0f) * 4.0f);
material.SetFloat("_IntersectionWidth", 0.3f);
material.SetVector("_IntersectionScroll", new Vector4(0.5f, 0.2f, 0, 0));Tips & gotchas
- The depth texture must be enabled, or the glow is invisible.
- Transparent geometry does not write depth, so two intersection-glow meshes cannot detect each other.
- On Android with MSAA, depth-resolve copies cost; disable MSAA or use the Forward+ resolve path.
- Width is in world units, so scale it with the camera distance if your views vary widely.
Related
- Depth Coloring — also reads scene depth.
- Hologram — pair for the canonical sci-fi shield.
- Emission — the glow feeds the same bloom pipeline.
- See-Through — silhouette through walls.
Last updated on