class RED::FrameStatistics

Information counters on the scene rendered by a window. More...

#include <REDFrameStatistics.h>

Inherits: Object.

Public functions:

FrameStatistics ( )
FrameStatistics ( const RED::FrameStatistics & iSrc )
~FrameStatistics ( )
virtual void *As ( const RED::CID & iCID )
virtual const void *As ( const RED::CID & iCID ) const
template< class T_As > const T_As *As ( ) const
template< class T_As > T_As *As ( )
intGetClusterEventsCount ( ) const
floatGetClusterFlushTime ( ) const
floatGetClusterGPUUpdateTime ( RED::CLUSTER_GPU_TIME iCounter ) const
floatGetClusterUpdateTime ( ) const
boolGetPassTimeQuery ( RED::RENDERING_PASS iPass ) const
intGetStateNumber ( ) const
intGetViewpointsCount ( int iVRLNumber ) const
const RED::ViewpointStatistics &GetViewpointStatistics ( int iVRLNumber, int iViewpointNumber ) const
const RED::ViewpointStatistics &GetViewpointStatistics ( RED::Object * iVRL, RED::Object * iViewpoint ) const
RED::Object *GetVRL ( int iVRLNumber ) const
intGetVRLsCount ( ) const
RED::Object *GetWindow ( ) const
RED_RCoperator= ( const RED::FrameStatistics & iSrc )
voidQueryPassTime ( RED::RENDERING_PASS iPass, bool iEnableTimer )

Public static functions:

static RED::CIDGetClassID ( )

Detailed description:

Information counters on the scene rendered by a window.

This class gives access to calculation counters on a frame. An instance of this object is sent to the RED::RENDERING_PROGRESS_CALLBACK that is defined by the RED::IWindow::SetRenderingProgressCallback method. This instance can also be accessed from the window that hosts it using RED::IWindow::GetFrameStatistics.

The software rendering of a frame is divided into rendering steps (RED::RENDERING_PROGRESS_STEP). Each rendering step is divided into rendering passes. Then, the RED::FrameStatistics object indicates various informations, such as the current step, the current pass, the progression in the pass, the number of objects in the scene, the number of rays actually processed, etc...

The hardware rendering of a frame is divided into rendering passes. Informations can be retrieved for each rendering pas that occurs for the rendering of the frame.

Statistics are accessible for each VRL and for each camera in that VRL. Use RED::FrameStatistics::GetViewpointStatistics to access these statistics.

By default, statistics have no hardware rendering passes timers enabled, as these timers are intrusive and slow down the rendering of the frame. Hardware timers can be setup using RED::FrameStatistics::QueryPassTime.

Functions documentation

FrameStatistics default construction method.

FrameStatistics copy construction operator.

Parameters:

iSrc:Source of the copy.

FrameStatistics destruction method.

public virtual void * RED::FrameStatistics::As(const RED::CID &iCID)

Converts the object to an instance of the given type.

Parameters:

iCID:Requested class.

Returns:

An object pointer of the given class on success, NULL otherwise.

Reimplements: RED::Object::As.

public virtual const void * RED::FrameStatistics::As(const RED::CID &iCID) const

Converts the object to an instance of the given type.

Parameters:

iCID:Requested class.

Returns:

An object pointer of the given class on success, NULL otherwise.

Reimplements: RED::Object::As.

template< class T_As > public const T_As * RED::FrameStatistics::As() const

Template version of the as const method.

Simply set T to be the class you want to retrieve an interface to.

Returns:

A pointer to a const instance of class T on success, NULL otherwise.

Reimplements: RED::Object::As.

template< class T_As > public T_As * RED::FrameStatistics::As()

Template version of the as method.

Simply set T to be the class you want to retrieve an interface to.

Returns:

A pointer to an instance of class T on success, NULL otherwise.

Reimplements: RED::Object::As.

Returns:

The number of events in the cluster for the last transaction that was closed.

This method must be called from the same thread as the one that has closed the transaction

Return the cluster data flushing time taken during the last transaction closing operation.

This is the amount of time spent in the last RED::IResourceManager::EndState for several internal tasks, such as:

  • Commiting changes in modified scene graph objects,
  • Flushing pending destruction orders.
  • Flushing useless working rendering buffers.

Returns:

The flush time spent in RED::IResourceManager::EndState for the last closed transaction.

Return a chunk of the cluster GPU update time taken during the last transaction closing operation.

The RED::CGT_ALL returns the entire cluster GPU update time.

Parameters:

iCounter:The requested time counter.

Returns:

The requested cluster GPU update time slice.

Return the time taken by the last cluster update.

This is the time taken by the last transaction closing operation (RED::IResourceManager::EndState), retrieved directly from the resource manager object. All windows will report the same time for the same transaction number.

The cluster update time is the sum of the RED::FrameStatistics::GetClusterFlushTime and RED::FrameStatistics::GetClusterGPUUpdate time.

Returns:

The time spent in RED::IResourceManager::EndState for the last closed transaction.

Query the actual timing of a pass.

Parameters:

iPass:The rendering pass.

Returns:

true if the pass is synchronized, false otherwise.

Gets the rendered transaction number for which the statistics were created.

Returns:

The corresponding transaction number.

Access the number of viewpoints registered for a given VRL number.

Parameters:

iVRLNumber:the number of the VRL in the class.

Returns:

The number of viewpoints for the i-th VRL in the statistics object.
public const RED::ViewpointStatistics & RED::FrameStatistics::GetViewpointStatistics(intiVRLNumber,
intiViewpointNumber
)const

Access the viewpoint frame statistics.

Parameters:

iVRLNumber:The number of the VRL in the class.
iViewpointNumber:The number of the viewpoint in the VRL.

Access statistics for a given viewpoint.

Parameters:

iVRL:The VRL hosting the viewpoint.
iViewpoint:The searched viewpoint.
public RED::Object * RED::FrameStatistics::GetVRL(intiVRLNumber) const

Returns:

The VRL corresponding to the requested iVRLNumber.

Parameters:

iVRLNumber:The requested VRL number.

Access the number of VRLs registered in the statistics.

Returns:

The number of VRLs actually rendered and having statistics data.

Gets the rendered window.

This method returns the window object being rendered and for which this statistics object is being created.

Returns:

The window address.

Assignment operator.

Parameters:

iSrc:Source of the operation.

Returns:

RED_OK if the operation has succeeded,
RED_ALLOC_FAILURE if an internal allocation has failed.
public void RED::FrameStatistics::QueryPassTime(RED::RENDERING_PASSiPass,
booliEnableTimer
)

Request timing of a pass.

Hardware rendering passes are all interleaved during the rendering of a frame. Therefore, timers are not relevant, as a pass execution does not occur right after rendering commands for it have been emitted.

This method can be used to enable timers and queries for the real time spent in a rendering pass. Setting iEnableTimer to true for iPass will cause a slight slowdown of the rendering (around 0.25 ms) for each instance of that pass during the processing of a frame. The time spent in that pass will then be available from the RED::PassStatistics class associated to that pass.

Parameters:

iPass:The rendering pass.
iEnableTimer:Set to true to enable timers for that pass, false to disable timers (default).