Vizard 8 » Command Index » Vizard modules » viz » <viz>.getRenderStats
8.1

<viz>.getRenderStats

Get render stats from last frame

<viz>.getRenderStats()  

Remarks

This command will return various rendering statistics from the last frame and return them through a viz.RenderStats object.

Before calling this command you must first enable render stats collection using the <viz>.setCollectRenderStats command. After enabling the collection of render stats, you will need to wait a frame for the render stats to become available.

Return Value

A viz.RenderStats object containing the following attributes:

Attribute

Description

frameTime

Total number of seconds spent on frame

updateTime

Seconds spent updating the scene. This can include animations, physics, and any code executed by your script

cullTime

Seconds spent processing the scene graph and deciding which objects to draw based on the current viewpoint

drawTime

Seconds spent sending the draw commands to the graphics driver

swapTime

Seconds spent swapping the frame buffer and performing other post-render tasks (drawing framerate, capturing screenshots, etc..)

gpuTime

Seconds spent on the GPU drawing the scene. This statistic is only available on OpenGL drivers that support the GL_EXT_timer_query extension

effectComposeTime

Seconds spent composing shader effects. Includes generating shader code and applying effect properties.

primitiveCount

The number of OpenGL primitives (triangles, quads, lines, points, etc...) rendered

drawableCount

The number of drawables (i.e. individual meshes) rendered this frame

systemMemory

The amount of system memory (in megabytes) used by the current process

gpuMemory

The amount of GPU memory (in megabytes) currently in use by all processes. This statistic is only available on OpenGL drivers that support the GL_NVX_gpu_memory_info extension.

Example

import viz
import vizact
viz.go()

viz.add('piazza.osgb')

viz.setCollectRenderStats(True)

def PrintStats():
    print(viz.getRenderStats())

vizact.onkeydown(' ',PrintStats)

See also

<viz>.setCollectRenderStats