class RED::FrameStatistics
Information counters on the scene rendered by a window. More...
#include <REDFrameStatistics.h>
Inherits: Object.
Public functions:
Public static functions:
static RED::CID | GetClassID ( ) |
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.
public RED::FrameStatistics::FrameStatistics | ( | const RED::FrameStatistics & | iSrc | ) |
FrameStatistics copy construction operator.
Parameters:
iSrc: | Source of the copy. |
FrameStatistics destruction method.
public static RED::CID RED::FrameStatistics::GetClassID | ( | ) |
Reimplements: RED::Object::GetClassID.
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:
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:
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:
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:
Reimplements: RED::Object::As.
public int RED::FrameStatistics::GetClusterEventsCount | ( | ) const |
Returns:
This method must be called from the same thread as the one that has closed the transaction
public float RED::FrameStatistics::GetClusterFlushTime | ( | ) const |
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:
public float RED::FrameStatistics::GetClusterGPUUpdateTime | ( | RED::CLUSTER_GPU_TIME | iCounter | ) const |
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:
public float RED::FrameStatistics::GetClusterUpdateTime | ( | ) const |
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:
public bool RED::FrameStatistics::GetPassTimeQuery | ( | RED::RENDERING_PASS | iPass | ) const |
Query the actual timing of a pass.
Parameters:
iPass: | The rendering pass. |
Returns:
public int RED::FrameStatistics::GetStateNumber | ( | ) const |
Gets the rendered transaction number for which the statistics were created.
Returns:
public int RED::FrameStatistics::GetViewpointsCount | ( | int | iVRLNumber | ) const |
Access the number of viewpoints registered for a given VRL number.
Parameters:
iVRLNumber: | the number of the VRL in the class. |
Returns:
public const RED::ViewpointStatistics & RED::FrameStatistics::GetViewpointStatistics | ( | int | iVRLNumber, |
int | iViewpointNumber | ||
) | 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. |
public const RED::ViewpointStatistics & RED::FrameStatistics::GetViewpointStatistics | ( | RED::Object * | iVRL, |
RED::Object * | iViewpoint | ||
) | const |
Access statistics for a given viewpoint.
Parameters:
iVRL: | The VRL hosting the viewpoint. |
iViewpoint: | The searched viewpoint. |
public RED::Object * RED::FrameStatistics::GetVRL | ( | int | iVRLNumber | ) const |
Returns:
Parameters:
iVRLNumber: | The requested VRL number. |
public int RED::FrameStatistics::GetVRLsCount | ( | ) const |
Access the number of VRLs registered in the statistics.
Returns:
public RED::Object * RED::FrameStatistics::GetWindow | ( | ) const |
Gets the rendered window.
This method returns the window object being rendered and for which this statistics object is being created.
Returns:
public RED_RC RED::FrameStatistics::operator= | ( | const RED::FrameStatistics & | iSrc | ) |
Assignment operator.
Parameters:
iSrc: | Source of the operation. |
Returns:
public void RED::FrameStatistics::QueryPassTime | ( | RED::RENDERING_PASS | iPass, |
bool | iEnableTimer | ||
) |
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). |