Vixen
02b45cc4
csharp
public sealed class ViewportStats

What 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 Smoothing

    How much of a new frame time is taken, per frame.

  • public int Entities

    How many entities were drawn as surfaces.

  • public int Triangles

    How many triangles went into the frame's mesh buffer.

  • public int Segments

    How many line segments went into its line buffers.

  • public int Draws

    How many draw calls the pane issued.

  • public float FrameMilliseconds

    How long a frame takes, smoothed, in milliseconds.

  • public float FramesPerSecond

    How 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