Vixen
02b45cc4
csharp
public sealed class PostProcessVolumeSystem

Folds the volumes the camera is in into one overlay for the frame.

Read the guide page for this →

As a system

Phase
PreRender

Remarks

The whole of what a post-process volume is at run time. Gather every PostProcessVolume, weigh each by how far the camera is from it, sort by priority, and lay them over one another in that order. What comes out is a PostProcessOverlay the frame's nodes read — see IPostProcessTarget.

In PreRender, ordered by its declared access, the same placement LightExtractionSystem explains: TransformSystem writes WorldTransform in the same phase and this reads it, so a volume that moved this frame is tested where it now is rather than where it was.

⚠ The camera's position comes from the view rather than from the world. The view is what the frame is actually drawn through — CameraExtractionSystem has already decided which of a scene's cameras won — so asking the world again would be a second answer to a question already settled, and would disagree the moment a scene had two cameras.

⚠ Sorted ascending and folded in that order, because the fold is not commutative. Priority decides which volume is on top, and "on top" means applied last. A stable sort is not required and is not promised: two volumes at one priority resolve arbitrarily, which the component's own remarks call a level-design mistake rather than a case to define.

Fields and properties (5)

  • public RenderView View

    The view this reads a camera position from.

  • public PostProcessOverlay Overlay

    What the last pass folded to.

  • public int VolumeCount

    How many volumes the last pass saw.

  • public int ContributingCount

    How many of them contributed anything.

  • public SystemAccess Access

Methods (3)

  • public PostProcessVolumeSystem(RenderView view)

    Folds the volumes the camera is in into one overlay for the frame.

  • public override JobHandle Update(in SystemContext context, JobHandle dependency)

    Runs the system.

  • public void Fold(World world)

    Gathers, sorts and folds this frame's volumes.

Used by (3)

  • ArenaThirdPersonShooter
  • AppGraphicsVixen.App.Hosting
  • PostProcessVolumeTestsVixen.Rendering.Tests