Skip to Content
DocumentationFeaturesIntersection Glow

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.

Video

A transparent force-field bubble moving across uneven terrain, with a bright cyan HDR glow tracing the contact line wherever the bubble intersects the ground and props.

features/intersection-glow/intersection-forcefield.mp4

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.

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.

Transparent sphere reads as a flat alpha-blended hull.

A bright cyan line where the sphere meets the floor, fading inward over 0.3m.

Plain sphere
Intersection glow · cyan HDR

A plain transparent hull against one with intersection glow. Drag to compare.

Properties

Inspector labelShader propertyTypeDefaultDescription
Glow Color_IntersectionColorColor (HDR)RGB(0.3, 0.9, 1.0)HDR glow tint.
Width_IntersectionWidthFloat (0–2)0.25World-space distance over which the glow fades.
Power_IntersectionPowerFloat (0.1–8)2.0Sharpness of the falloff curve.
Intensity_IntersectionIntensityFloat (0–8)2.0Overall multiplier; go HDR for bloom.
Noise Texture_IntersectionNoiseTexture2DNoneOptional noise to break up the line.
Noise Scroll_IntersectionScrollVector4(0, 0.2, 0, 0)UV scroll for the noise, creating flowing energy.

Usage

  1. Enable Depth Texture on the URP Asset (required).
  2. Switch the material to Transparent.
  3. Enable Intersection Glow and pick a color. HDR intensities of 2–6 sell the effect through Bloom.
  4. 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.
Last updated on