Vixen
dd8b0a81
csharp
public static class ViewShading

What each view mode means to the editor's own tool renderer.

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

Remarks

Two answers to "show me the normals" and this is the near one. ViewModes is the real one — a mode is a compositor tree, which is what doc 06 made the compositor data for — and it is fed now: EditorWorldRenderer holds a GraphicsCompositor and a view per pane, EditorFrames.RegisterViewModes hands each pane the subtrees for its own view, and EditorHost.Composes draws through FramePresenter for any mode that has one.

⚠ What it registers is shaded, and wireframe on a device that reports HasWireframe — no more. Albedo, unlit, normals and roughness have no tree, and nor does any pane past EditorWorldRenderer.MaxPanes or any pane but the first under an authored .vxcompositor. All of those keep the editor's own tool renderer, which is SceneMeshes through MeshInstanceRenderer: device-resident shapes, one instance per entity, one colour and one directional term, and no material anywhere. This table is what that path can honestly express, and it is a live fallback rather than a stage the editor has left behind.

⚠ The three it cannot express say so rather than falling back. Resolve falls back to shaded for a mode with no tree registered, which is right for a compositor that has not been authored and wrong for a menu item: a line that draws the same picture as the line above it is a control the user tries twice and then stops trusting. IsSupported is what lets the Scene menu register those three as declared-and-disabled with the reason, which is doc 20's first bar.

Fields and properties (1)

  • public static IReadOnlyList<ViewMode> All

    Every mode, in the order the View Mode menu offers them.

Methods (9)

  • public static bool IsSupported(ViewMode mode)

    Whether the editor's tool renderer can draw a mode at all.

  • public static bool DrawsSurfaces(ViewMode mode)

    Whether a mode draws surfaces.

  • public static bool DrawsEdges(ViewMode mode)

    Whether a mode draws the edges of those surfaces.

  • public static float AmbientFor(ViewMode mode, float shaded)

    How much light a surface facing away from the key still receives.

  • public static bool ColoursByNormal(ViewMode mode)

    Whether a surface is coloured by its normal rather than by what it is.

  • public static bool ColoursByRoughness(ViewMode mode)

    Whether a surface is coloured by its roughness rather than by what it is.

  • public static bool IgnoresSelectionColour(ViewMode mode)

    Whether a mode ignores the selection's colour.

  • public static string NameOf(ViewMode mode)

    What a mode is called in a menu.

  • public static string SlugOf(ViewMode mode)

    What a mode is called in a command id.

Used by (6)

  • EditorApplicationVixen.Editor.App
  • SceneMaterialTestsVixen.Editor.SceneView.Tests
  • SceneMeshesVixen.Editor.SceneView
  • ScenePresenterVixen.Editor.App
  • ViewportIdsVixen.Editor.App
  • ViewportStateTestsVixen.Editor.SceneView.Tests