Vixen
caa30e12
csharp
public sealed class TextureCopyRenderer

A snapshot of one target in another, as a transfer pass.

Read the guide page for this →

Remarks

What [35 § B1](../../../docs/plan/35-water.md#b1-there-is-no-shading-model-that-can-read-the-scene-behind-it) turned out to need, and it is not the pass. The compositor could already express "run after deferred lighting, read the scene colour, write the scene colour" — ReflectionTrace binds sceneColor today. What it could not express is the part that makes that legal: sampling a target a pass is also writing is undefined behaviour, so the read has to come from somewhere else, and that somewhere has to be a resource the graph knows the lifetime of.

The graph is what makes this worth a node. A copy recorded by hand needs two barriers around it, needs to know whether its source is still a colour attachment, and becomes wrong the moment a pass is inserted before it. Declared, it is two resource uses and the graph derives the rest — including dropping the whole copy when nothing reads the destination, which is what makes a document that has a water node cost nothing in a scene with no water.

⚠ Refuses rather than rescales. A copy needs matching formats and matching sizes; where they differ the operation a caller wants is a blit, which is a draw and a different node. Silently taking the smaller region would produce a scene-colour copy that is correct in the top-left corner, which is exactly the kind of wrong that survives review.

Fields and properties (3)

  • public required string Source

    The name of the target to copy, which must be declared as a copy source.

  • public required string Destination

    The name of the target it goes into, which must be declared as a copy destination.

  • public int CopyCount

    How many frames have been copied.

Methods (1)

Used by (3)

  • CompositorAssetTestsVixen.Rendering.Tests
  • CompositorBuilderVixen.Rendering
  • TextureCopyTestsVixen.Rendering.Tests