Skip to content

FrameStats beta ​

Interface of @v12-engine/render

ts
export interface FrameStats

What a frame drew

Members ​

cascades ​

ts
cascades: {
        draws: number;
        copies: number;
        triangles: number;
    }[];

What each cascade keeps, drawn this frame or not: its draws, copies and triangles

cascadesDrawn ​

ts
cascadesDrawn: number;

How many cascades of the sun's shadows were drawn again this frame (the rest kept last frame's depth)

copies ​

ts
copies: number;

Copies and triangles in the view's pass

cpu ​

ts
cpu?: {
        name: string;
        ms: number;
    }[];

What the renderer's frame takes on the processor, by part (FRAME_PARTS, in their order), in milliseconds a frame over the last second, while it is timed (Renderer.timePasses): the game's own frame (onFrame's callbacks), the side views, culling the main view, the picture's passes, the cascades, the uniforms, the copies sent to the card and encoding and submitting the frame. The card works on a frame while the next is made: the processor's time and the card's (gpuMs) overlap, and neither is the time between two frames

draws ​

ts
draws: number;

The draws of the view's pass and the cascades drawn, the view's clear counted as one

frames ​

ts
frames: number;

How many frames have been drawn

gpuMs ​

ts
gpuMs?: number;

The card's time of a frame, over the last second, while the frame is timed (Renderer.timePasses) and the card stamps its passes (WebGPU's timestamp-query): each frame's from the start of its first pass to the end of its last, a frame or two behind, averaged. Passes overlap on the card, so it is not their sum. None while not timed

nearestRead ​

ts
nearestRead?: number;

Of the main view, how near along it the nearest of what it draws that reads the shadows is, in cells (0: not looked for)

passTimes ​

ts
passTimes?: {
        name: string;
        ms: number;
    }[];

The card's time of each pass of a frame, in milliseconds, by its name (the frame graph's tasks of one name summed: view, view, last, cascade 0, cascade 0, still, the picture's passes), over the last second, the heaviest first: while Renderer.timePasses is on and the card times them (WebGPU's timestamp-query), a frame or two behind. Passes may overlap on the card: their sum is not the frame's (gpuMs)

skipped ​

ts
skipped?: number;

Of the main view: the screen's frames left out under Renderer.maxFps, since the renderer was made

stillDrawn ​

ts
stillDrawn: number;

Of those, how many drew their still layer again (the rest only put it back and drew what moves)

triangles ​

ts
triangles: number;

The triangles in the view's pass

unread ​

ts
unread?: number;

Of the main view, the cascades no pixel reads this frame, not drawn: each ends nearer the camera than the nearest of what the view draws that reads the shadows (nearestRead, along the view; 0 where every cascade may be read; worked out no nearer than the cascades' ends tell apart, so not always to the cell)