Multi Frequency Rendering
Description
This chapter briefly describes the Multi Frequency Rendering technique supported by Candera.
It allows to split rendering of complex parts to several frames, to achieve an overall higher frame rate.
Contents List
Candera - Camera Render Strategy
Candera - Break Node Camera Render Strategy
Candera - Benchmark Camera Render Strategy
Candera - Render Pass Actions
Example - Multi Frequency Rendering
Multi Frequency Rendering in 2D
Limitations
Introduction
Multi Frequency Rendering Introduction
Multi Frequency Rendering allows using different update rates for multiple render targets. For example
Adaptive framerate for center use case.
Details of entire content are preserved.

Workflow
Candera::CameraRenderStrategy
The following sections explain how an application can use the Candera::CameraRenderStrategy to implement multi frequency rendering based on given benchmark values within the scene tree.
References
For details about how to calculate benchmark values and how to assign them to a scene tree, please refer to:
Candera - Camera Render Strategy
Partitioning Render Passes
A Camera render pass renders all scene nodes in one sweep.
Candera::CameraRenderStrategy enables to partition a Camera render pass, if e.g. complete processing in one frame is not possible.
Examples of Usage
Multi Frequency Rendering: Suspend and continue Camera render pass next time Camera renders. Unless render pass is complete, render target is not swapped.

Both, Candera::BreakNodeCameraRenderStrategy and Candera::BenchmarkCameraRenderStrategy are concrete implementations of the interface Candera::CameraRenderStrategy to cover most typical Camera render pass partitioning.
Candera - Break Node Camera Render Strategy
Splitting Render Pass on specific Break Nodes
The Candera::BreakNodeCameraRenderStrategy is populated with a list of arbitrary break nodes.
Defined by RenderPassAction a break node can pause or stop a Camera render pass, if encountered.
breakNodeStrategy = new BreakNodeCameraRenderStrategy(); breakNodeStrategy->AddBreakNode(node4); breakNodeStrategy->AddBreakNode(node7); breakNodeStrategy->SetRenderPassActionOnBreakNode(renderPassAction); camera->SetCameraRenderStrategy(breakNodeStrategy);

Candera - Benchmark Camera Render Strategy
Splitting Render Pass on Benchmark Threshold Values
Each node has a benchmark property that describes a custom reference value for render duration.
During Camera render pass benchmarks are accumulated until threshold of Candera::BenchmarkCameraRenderStrategy is reached. RenderPassAction defines to suspend or stop render pass.
benchmarkStrategy = new BenchmarkCameraRenderStrategy(); node1->SetRenderBenchmark(250.0f); node2->SetRenderBenchmark(330.0f); node3->SetRenderBenchmark(220.0f); node4->SetRenderBenchmark(400.0f); node5->SetRenderBenchmark(390.0f); benchmarkStrategy->SetThreshold(1000.0f); benchmarkStrategy->SetRenderPassActionOnThreshold(renderPassAction); camera->SetCameraRenderStrategy(benchmarkStrategy);

Candera - Render Pass Actions
Render Pass Actions
Usage: Entire content captured by Camera shall be displayed Stops rendering. The next time the Camera renders it restarts from the very first node in render order. Swaps render target at each render cycle.
Usage: Nodes with lower priority shall be omitted.
Example - Multi Frequency Rendering
Example: Different Frame Rates for several Cameras
Cycle 1
Cycle 2
Multi Frequency Rendering in 2D
Analogous to Candera::CameraRenderStrategy, there is an abstract class Candera::Camera2DRenderStrategy available.
This class is intended to be derived to tell the Candera::Renderer2D, if rendering shall proceed, pause, or stop for a given node in a camera's render pass.
BreakNodeCamera2DRenderStrategy
In difference to 3D, Candera 2D Engine only provides a Candera::BreakNodeCamera2DRenderStrategy to split a 2D render pass along specific break nodes.
Limitations
MFR animation issue
Using an AnimationReq-Message in combination with MFR results in an wrong output since the animation progresses during each partial drawn frame. One idea is to check if the view uses MFR and if used the view would provide it's own AnimationTime-Dispatcher which only gets updated during the Update call. The animation for this view would then be added to this time dispatcher. This allows to use animations as long as they only affect a single scene.
MFR transition issue
Using a Scene-Transition in combination with MFR results in an wrong output since the transition progresses during each partial drawn frame. Transitions should check the status of the camera and only perform an modification if the Render-Pass is complete. This would allow transitions to be used if only one Scene is active per Render-Target. To allow multiple scenes per Render-Target (more common case) all Cameras in the transition need to be "synced".







