Vixen
dd8b0a81
csharp
public sealed class ViewModes

The compositor a viewport uses for each way of looking at the scene.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

A mode is a compositor, not a flag. Doc 06 made the compositor data precisely so that "show me the normals" is a different tree rather than a branch inside the renderer, and this is where that is collected. A host registers the trees it has; a mode with no tree registered falls back to Shaded rather than showing nothing, because a menu item that appears to do nothing is worse than one that does the safe thing.

The two modes that are not a different tree are here as stage state. Wireframe and overdraw are the same geometry drawn with a different rasterizer and a different blend, so a host that has not authored a compositor for them can have them by handing over the stage they draw — which is what ApplyTo is for. Everything else genuinely needs a different shader and therefore a different tree.

Fields and properties (2)

  • public ViewMode Current

    Which mode the viewport is in.

  • public IReadOnlyCollection<ViewMode> Registered

    The modes a compositor has been registered for.

Events (1)

Methods (5)

  • public void Register(ViewMode mode, SceneRenderer renderer)

    Registers the compositor tree for a mode.

  • public void Clear()

    Forgets every registered tree.

  • public SceneRenderer? Resolve()

    The tree for the current mode.

  • public SceneRenderer? Resolve(ViewMode mode)

    The tree for a mode.

  • public void ApplyTo(RenderStage stage)

    Puts the current mode's stage state onto a stage.

Used by (13)

  • ComposedPaneCaptureTestsVixen.Editor.App.Tests
  • ComposedPaneTestsVixen.Editor.App.Tests
  • EditorApplicationVixen.Editor.App
  • EditorHostVixen.Editor.Host
  • EditorWorldRendererVixen.Editor.App
  • FramePresenterVixen.Editor.App
  • FramePresenterTestsVixen.Editor.App.Tests
  • SceneMaterialTestsVixen.Editor.SceneView.Tests
  • SceneMeshesVixen.Editor.SceneView
  • ScenePresenterVixen.Editor.App
  • SceneViewportVixen.Editor.SceneView
  • ViewportStateTestsVixen.Editor.SceneView.Tests
  • ViewportTestsVixen.Editor.App.Tests