Figure: Subtract particle depth from scene depth in the same linear space, then divide by fade distance. A smaller gap fades the particle.
Figure: Subtract particle depth from scene depth in the same linear space, then divide by fade distance. A smaller gap fades the particle.

Cause and mechanism

Soft particles fade where a particle intersects a floor or wall. Compare background and particle depth using the same units and reference space, then reduce alpha near the intersection. Raw Screen Position W is not a universal depth value, especially with orthographic cameras, so test the camera type you use.

Check and correct the setup

  1. Enable scene depth and linearize it; Opaque Texture is color, not depth.
    Inspect background, foreground and transparency separately
    Inspect background, foreground and transparency separately
  2. Compute particle eye depth in the same units and direction.
    Inspect background, foreground and transparency separately
    Inspect background, foreground and transparency separately
  3. Multiply alpha by saturate((sceneDepth-particleDepth)/max(fadeDistance,epsilon)); test perspective and orthographic paths.
    Inspect background, foreground and transparency separately
    Inspect background, foreground and transparency separately

Limits and verification

Transparent surfaces absent from the depth texture are not automatically supported. Use projection-aware depth linearization.

Shader Graph: Scene Depth sampling modes

A focused diagnostic setup

Use one particle intersecting an opaque floor. Visualize the depth difference before adding a fade width and verify its sign.

Test in this order

  1. Convert scene and particle values to matching eye-depth units.
    Inspect background, foreground and transparency separately
    Inspect background, foreground and transparency separately
  2. Multiply alpha by the fade using a positive distance and check the intersection.
    Inspect background, foreground and transparency separately
    Inspect background, foreground and transparency separately
  3. Test perspective, orthographic projection, clip distances and camera movement.
    Inspect background, foreground and transparency separately
    Inspect background, foreground and transparency separately

Interpret the result

Whole-particle disappearance suggests mismatched units, sign or input depth. Failure only on a transparent floor suggests missing depth coverage. Correct the depth difference before widening the fade.

Related explanations

References