Vixen
02b45cc4
csharp
public readonly record struct NodePreview

What a node's output looks like, small, under the node.

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

Remarks

Two kinds, because the two questions are different. Doc 11 asks for live preview thumbnails, which for a shader graph means compiling one node's expression and running it over a quad; that is Image, and it is drawn exactly the way Viewport draws a scene — a number the renderer was given, handed back in an image command. A swatch is the other kind and is not a placeholder for it: a constant, a colour, a mask and a channel split all reduce to one colour, and rendering a quad to say so would be a render target per node to answer a question a rectangle answers.

⚠ A number the renderer does not know draws nothing at all, which is Viewport.RenderTarget's warning and applies here for the same reason. A preview that went blank is a target that was recreated and not re-registered — so a source that cannot guarantee its handle is live should answer with a colour instead.

Fields and properties (4)

  • public Color4 Color

    The colour to show when there is no image, or the tint when there is one.

  • public string Label

    A few characters over it — a number, a width — or empty.

  • public ulong Image

    The renderer's handle for a thumbnail rendered into a target, or zero for a flat swatch.

  • public bool FlipVertically

    Whether that target is upside down, as a scene's is.

Methods (1)

  • public NodePreview(Color4 Color, string Label = "", ulong Image = 0, bool FlipVertically = false)

    What a node's output looks like, small, under the node.

Used by (5)

  • FixedVixen.Editor.NodeGraph.Tests
  • INodePreviewSourceVixen.Editor.NodeGraph
  • NodePreviewLayerVixen.Editor.NodeGraph
  • RecorderVixen.Editor.NodeGraph.Tests
  • ViewTestsVixen.Editor.NodeGraph.Tests