public sealed class ViewportStatsWhat one pane cost this frame, for the readout in its corner.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Written by whatever builds the frame and read by whatever draws the overlay. The counts are the collectors' own — how many entities were drawn, how many triangles and segments went into the buffers — and the frame time is the host's, because a pane has no clock. Neither half is computed here; this is the place the two meet, which is what stops the overlay reaching into a renderer.
⚠ The frame time is smoothed and the counts are not. A number that changes sixty times a second is a number nobody can read, and an average over a fifth of a second is what every profiler's headline figure is. The counts are exact because they are answers to "what is in this scene" rather than measurements — a triangle count that drifted towards its neighbours would be a bug report nobody could reproduce.
Fields and properties (7)
public const float SmoothingHow much of a new frame time is taken, per frame.
public int EntitiesHow many entities were drawn as surfaces.
public int TrianglesHow many triangles went into the frame's mesh buffer.
public int SegmentsHow many line segments went into its line buffers.
public int DrawsHow many draw calls the pane issued.
public float FrameMillisecondsHow long a frame takes, smoothed, in milliseconds.
public float FramesPerSecondHow many frames a second that is.
Methods (2)
public void Sample(TimeSpan delta)Folds one frame's duration into the average.
public void Clear()Forgets the counts, for a pane that drew nothing.
Used by (5)
- EditorApplicationVixen.Editor.App
- ScenePresenterVixen.Editor.App
- SceneViewportVixen.Editor.SceneView
- ViewportChromeVixen.Editor.App
- ViewportStateTestsVixen.Editor.SceneView.Tests