Vixen
feb85697
csharp
public record class UiComposeAsset

Where a document composes its interface: after the scene, over the target it names.

Read the guide page for this →

Remarks

⚠ A HUD's top-level mix-blend-mode and backdrop-filter read the scene only when the frame says where the scene is (#1378). WorldRenderer.Draw composes an interface's groups in its prologue, before any pass of the frame has run, so a group that reads what lies beneath it reads the interface over transparent black: a multiplied panel lands as its own flat colour on the world and a glass panel blurs nothing. UiRenderFeature.Sceneless counts every such group. Placed in a document — at a !StandardFrame's beforeUi seam, ahead of the pass that draws the interface stage — this node moves that work to after the scene and hands it Source as what lies beneath, and the prologue then leaves the interface to it.

⚠ The same frame's scene, not the previous one's, and that is why it is a node. The other way to give a HUD its scene is last frame's colour target, which costs a frame of lag in every blended panel and still needs a copy taken at this same seam — otherwise the HUD blends with its own previous picture. A render-graph pass with no attachments runs its body outside any render pass, which is exactly where UiRenderer.Compose has to be recorded, and declaring a read of Source is what places it after whatever wrote the scene.

⚠ Source has to be sampleable, and what decides that is the usage the resource is declared or imported with — which, for the window, is the host's. The node refuses a target without Sampled at build time rather than binding one a driver may or may not sample.

⚠ In a game the default Source is the window, and until #1419 it was refused there. AppGraphics.Lend imports the acquired swapchain image under GraphicsOptions.Output — by default SceneColour, which is also !StandardFrame's default output — and an import wins over a declaration of the same name. It used to import it as TextureUsage.ColourTarget and nothing else, on every backend; it now declares ISwapChain.Usage, which is sampled on a windowed Vulkan chain wherever the surface and the chosen format both allow it, on OpenGL and on the offscreen chain. WebGPU's surface is not sampled, and this node still refuses to run over it there. HostedInterfaceComposeTests is the stock host drawing a multiplied HUD panel over the world through this node.

Fields and properties (3)

  • public string Name

    The node's name, for debug groups and for a human reading the file.

  • public bool Enabled

    Whether the node runs.

  • public string Source

    The target the interface is drawn into, holding the scene when this node runs.

Used by (6)

  • InterfaceOverASceneDeviceTestsVixen.Graphics.Golden.Tests
  • TypeRegistrationVixen.Ui.Renderer
  • UiComposeFactoryVixen.Ui.Renderer
  • Vixen_Ui_Renderer_UiComposeAssetSerializerVixen.Ui.Renderer
  • EditorWorldRendererTestsVixen.Editor.App.Tests
  • HostedInterfaceComposeTestsVixen.App.Tests