|
Katana Plug-in APIs 0.1
|
The Profiling Mock Renderer is a mock renderer plug-in that provides scene traversal profiling information. More...
#include <ProfilingMockRenderPlugin.h>
Public Member Functions | |
| RenderPlugin (FnKat::FnScenegraphIterator rootIterator, FnAttribute::GroupAttribute arguments) | |
| Constructor. | |
| ~RenderPlugin () override | |
| Destructor. | |
| int | start () override |
Reimplemented from RenderBase. | |
| int | stop () override |
Reimplemented from RenderBase. | |
| void | configureDiskRenderOutputProcess (FnKat::Render::DiskRenderOutputProcess &diskRenderOutputProcess, const std::string &outputName, const std::string &outputPath, const std::string &renderMethodName, const float &frameTime) const override |
Reimplemented from RenderBase. | |
Static Public Member Functions | |
| static FnKat::Render::RenderBase * | create (FnKat::FnScenegraphIterator rootIterator, FnAttribute::GroupAttribute arguments) |
| Constructs an intance of the class. | |
The Profiling Mock Renderer is a mock renderer plug-in that provides scene traversal profiling information.
The Profiling Mock Renderer performs no rendering, but instead traverses the entire scene graph as quickly as possible using a given traversal strategy.
Preview Render and Disk Render (from a Render node) are the two render methods supported. When rendering a scene with either of these methods, the plug-in will time and log how long it took for a location to be expanded, as well as the rate of locations expanded per second. In UI mode, the log will be visible in the Render Log tab. This is the format in which the log messages are reported:
>> Depth-first search: 0.00s 0.00 ms/loc 1 /root
>> Depth-first search: 0.00s 0.48 ms/loc 2 /root/world
>> Depth-first search: 0.00s 0.45 ms/loc 3 /root/world/geo
>> Depth-first search: 0.01s 2.03 ms/loc 4 /root/world/geo/primitive
>> Depth-first search: 0.01s 1.70 ms/loc 5 /root/world/cam
>> Depth-first search: 0.01s 1.46 ms/loc 6 /root/world/cam/camera
>> Depth-first search: 0.01s 1.31 ms/loc 7 /root/world/lgt
>> Depth-first search: 0.01s 1.19 ms/loc 8 /root/world/lgt/light
--------1--------- --2-- -----3----- -4- -----------5-------------
- 1 Traversal strategy log prefix
- 2 Elapsed time since the beginning of the render
- 3 Current traversal rate (time per location)
- 4 Number of locations that have been expanded
- 5 The current location path
Traversal strategies
Three traversal strategies are available:
dfs)bfs)parallel)Depth-first search
This approach starts at the root location and explores as far as possible along each branch before backtracking.
Depth-first traversal within a single thread makes best use of scene data caching within that thread's allocated Geolib runtime, while minimising memory consumption (matching the current best practice for single-threaded rendering).
Breadth-first search
This approach starts at the root location and explores all of the neighbor locations at the present depth prior to moving on to the locations at the next depth level.
Breadth-first traversal within a single thread makes poor use of scene data caching. Evaluating data from distant subtrees evicts data from previously computed locations. By the time the program execution returns to a certain subtree, all its previous data may have already been evicted.
Parallel search
This approach uses multiple threads to traverse subtrees, with each thread using a depth-first search. Idle threads acquire work from busy threads by stealing their oldest, and therefore shallowest task. This constitutes breadth-first division of work across multiple threads. Since different threads spawn distinct Geolib runtimes for concurrent evaluation, this strategy aims to minimise redundancy in scene cooking.
See How Task Scheduling Works for detailed information.
Global parameters
The ProfilingMockRendererGlobalSettings node provides several configuration parameters:
profilingMockRendererGlobalStatements.options.traversalStrategy: Available traversal strategies are dfs, bfs and parallel. Default is dfs. profilingMockRendererGlobalStatements.options.maxLogDepth: Log timing information for locations up to this depth. Default is 5. profilingMockRendererGlobalStatements.options.maxThreads: Max threads to use for the traversal. Relevant for the parallel traversal strategy only. If set to 0, the number of threads will be automatically determined based on hardware configuration. Default is 0.| ProfilingMockRenderer::RenderPlugin::RenderPlugin | ( | FnKat::FnScenegraphIterator | rootIterator, |
| FnAttribute::GroupAttribute | arguments | ||
| ) |
Constructor.
| rootIterator | The root FnScenegraphIterator used to traverse the Katana recipe. |
| arguments | Render arguments (e.g. render time). |
| void ProfilingMockRenderer::RenderPlugin::configureDiskRenderOutputProcess | ( | FnKat::Render::DiskRenderOutputProcess & | diskRenderOutputProcess, |
| const std::string & | outputName, | ||
| const std::string & | outputPath, | ||
| const std::string & | renderMethodName, | ||
| const float & | frameTime | ||
| ) | const [override, virtual] |
Reimplemented from RenderBase.
The Profiling Mock Renderer disables the monitor output, as no image is generated (Render::RenderAction::setLoadOutputInMonitor).
Reimplemented from Foundry::Katana::Render::RenderBase.
| static FnKat::Render::RenderBase* ProfilingMockRenderer::RenderPlugin::create | ( | FnKat::FnScenegraphIterator | rootIterator, |
| FnAttribute::GroupAttribute | arguments | ||
| ) | [static] |
Constructs an intance of the class.
This is used by the DEFINE_RENDER_PLUGIN macro.
| rootIterator | The root FnScenegraphIterator used to traverse the Katana recipe. |
| arguments | Render arguments (e.g. render time). |
| int ProfilingMockRenderer::RenderPlugin::start | ( | ) | [override, virtual] |
Reimplemented from RenderBase.
This function is called at the start of the render process.
Reads the configurable renderer global setting from the /root location.
Implements Foundry::Katana::Render::RenderBase.
| int ProfilingMockRenderer::RenderPlugin::stop | ( | ) | [override, virtual] |
Reimplemented from RenderBase.
Called at the end of the render process. The Profiling Mock Renderer does not perform any action when this message is received.
Reimplemented from Foundry::Katana::Render::RenderBase.
1.7.3