Vixen
caa30e12
csharp
public interface IPostProcessShape

A region a post-process volume applies inside.

Read the guide page for this →

Remarks

What replaced the axis-aligned box test ([35 § B2](../../../docs/plan/35-water.md#b2-doc-32s-volumes-are-boxes)). A volume used to be a box and only a box, and the containment test was written into the fold; underwater is a volume whose shape is below this surface and inside this body, which is not a box, is not static, and moves with the waves.

⚠ A water body must not be the only non-box shape. An interface with one built-in implementation and one special case is an interface shaped like its special case — so a sphere lands with it, and the two built-ins are what the fold is written against.

The point is in world space and the distance is in the shape's own. A shape is asked about a world position because a water body's is a world-space query and cannot be expressed as a transform of a canonical one; what comes back is compared against BlendRadius, which has always been in the volume's own units — a volume scaled by two reaches twice as far, and that is the documented behaviour rather than a rounding of it.

Implemented by readonly structs, and the fold calls the built-ins as concrete types. The interface is what makes a third shape possible; it is not what the two shapes every frame goes through, because a per-volume interface dispatch is a per-volume allocation waiting to be written.

Methods (1)

  • bool Contains(Vector3 world, out float distanceOutside)

    Whether a world-space point is inside, and how far outside it is when it is not.

Used by (7)

  • BelowZeroVixen.Rendering.Tests
  • BoxPostProcessShapeVixen.Rendering
  • IPostProcessShapeSourceVixen.Rendering
  • PostProcessVolumeSystemVixen.Rendering
  • SpherePostProcessShapeVixen.Rendering
  • UnderwaterShapeVixen.Rendering.Water
  • WaterZoneSystemVixen.Rendering.Water