Vixen
dd8b0a81
csharp
public sealed class DebugOverlayRenderer

The compositor node that puts a frame's DebugDraw on the screen.

Read the guide page for this →

Remarks

The missing half of a link that was complete at both ends. Physics, navigation, animation, the AI stack and water's six water.show* verbs have all been drawing into the accumulator for phases; DebugDrawRenderer has been able to turn it into two draw calls for just as long, with a golden image to prove it. What did not exist was anything in a running game that owned one — DebugDrawRenderer's only constructor call in the tree was its own golden test — so every one of those producers wrote into a list nothing read.

⚠ It declares its own pass rather than drawing inside somebody else's. A node that drew as a child of the final !RenderPass would be recorded before tone mapping and the screen chain, so an overlay's colours would come out graded and its one- pixel lines would come out through FXAA. A pass of its own over the frame's last colour target, loading rather than clearing, is what puts it after everything — and it means no document has to be edited to get it, which is the whole point: a project authoring its own .vxcompositor would otherwise have to remember a node it never asked for.

⚠ Untested against depth, and that is a decision rather than an omission. The target it attaches to is a colour buffer at the end of the frame, by which point the scene's depth may have been aliased away by the graph — and an overlay panel that could be occluded is one that disappears exactly when something has gone wrong in front of it. A host that wants world lines hidden by geometry draws them from inside the scene pass, which is what the editor's viewport does.

⚠ Upload happens in the build phase, which is outside every render pass. That is the only place it can be: the accumulator is drained before the graph starts executing and the writes must not land inside a pass.

Fields and properties (6)

  • public string Target

    The name of the colour target it draws over.

  • public DebugDraw Draw

    The accumulator this drains, for a host that has to hand it to a system as well.

  • public int WorldCount

    How many world vertices the last frame held.

  • public int ScreenCount

    How many screen vertices — the overlay panels — the last frame held.

  • public int Dropped

    How many vertices the last frame dropped for want of room.

  • public int Draws

    How many draws the last frame issued: zero, one or two.

Methods (3)

  • public DebugOverlayRenderer(IGraphicsDevice device, LineShaders shaders, DebugDraw draw, RenderView view)

    Builds the node over an accumulator and the view its world lines are seen from.

  • protected override void Build(GraphicsCompositor compositor, CompositorFrame frame)

    Declares this node's render-graph passes.

  • public void Dispose()

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Used by (3)

  • AppGraphicsVixen.App.Hosting
  • SceneRenderHostVixen.Engine.Renderer
  • HostedOverlayTestsVixen.App.Tests