![]() |
PURE API 0.5
PR00F's Ultimate Rendering Engine full documentation
|
The engine uses CConsole logger for logging purpose.
Logging has to be explicitly enabled to see the logs and to generate log file. You can get the CConsole instance from the engine by PR00FsUltimateRenderingEngine::getConsole().
However, if you want to turn on logging before the engine is created/initialized, you should implicitly create the singleton CConsole instance with CConsole::getConsoleInstance() and set it up properly. For this you can see example of how I do it in tmcsEnableDebugging() of the gfxcore2 project.
Each PureManager and PureManaged instance is able to report its used memory by invoking its getUsedSystemMemory() method.
Some managers and manageds can also report their used video memory by invoking their getUsedVideoMemory() method.
Invoking any of the above functions of a manager instance reports the summarized amount of resource usage for all of its managed instances.
Each PureManager -derived manager is able to log its collected statistics and list of its managed objects by invoking its WriteList() method.
Render Hints are debug switches for the current renderer. These can be switched on-the-fly, so no reinitialization is needed.
Each renderer (a class implementing PureIRenderer interface) implements its own switches that are stored in a TPure_RENDER_HINT variable. See the detailed description at the actual renderer.
Use the current renderer's getRenderHints() and SetRenderHints() functions to access these switches.
These render hints can be logged anytime by invoking current renderer's PureIRenderer::WriteStats() implementation.
Each renderer (a class implementing PureIRenderer interface) implements so called "Current Statistics" that are being collected for arbitrary time duration. The first duration starts when the engine is initialized. From that point, the current renderer is updating its "Current Statistics" whenever its PureIRenderer::RenderScene() is invoked.
Normally this duration lasts until the engine is shut down.
However, if the current renderer's PureIRenderer::ResetStatistics() implementation is invoked, the "Current Statistics" are concluded, saved for later observation and reset. Reset means that a new duration is started from where new statistics are collected that are valid only for the new duration. This is why we say these are collected for arbitrary time duration, since you can always start a new duration whenever you want.
This feature is very useful when e.g. you want to measure average FPS from different camera views of the scene, or with different display settings, etc, without restarting your client application.
I personally used this feature when I was switching back-and-forth between different occlusion culling method settings, render paths, etc. without changing anything in the scene itself, to see how FPS was varying.
Resetting "Current Statistics" also saves the current Render Hints so you always know which render debug switches were applied to different "Current Statistics" durations if you are observing the log.
Currently following "Current Statistics" are collected per duration:
These statistics can be logged anytime by invoking current renderer's PureIRenderer::WriteStats() implementation.
Currently only PureRendererHWfixedPipe implements "Last Frame Statistics". These stats are automatically reset at the beginning of each frame and concluded at the end of each frame, meaning that these are just momentary values.
Currently following "Last Frame Statistics" are maintained:
These statistics can be logged anytime by invoking current renderer's PureIRenderer::WriteStats() implementation, and can be also programmatically queried by the getLastFrame...() functions of the current renderer.
PureObject3DManager collects HW occlusion query related statistics:
PureObject3DManager::WriteList() logs these with per-object granularity.
The current renderer's PureIRenderer::ResetStatistics() implementation saves and resets these stats too.
All above information mentioned previously on this page can be logged by a single call to PR00FsUltimateRenderingEngine::WriteList().
It also summarizes the summarized memory usages calculated by the managers.
Engine's WriteList() is automatically invoked if the user previously invokes SetAutoWriteStatsAtShutdown(true).