# Candera Engine 3D

#### New Functions in Renderer

[Renderer](http://dev.doc.cgistudio.at/APILINK/class_candera_1_1_renderer.html "The class Renderer represents the unique Candera render interface to the application. Each render call an base of Candera shall be triggered via the Renderer interface.") has new functions to activate and deactivate a camera ([Renderer::ActivateCamera](http://dev.doc.cgistudio.at/APILINK/class_candera_1_1_renderer.html#a877ebbcf0c736d86fd13cb24a0eac593), [Renderer::DeactivateCamera](http://dev.doc.cgistudio.at/APILINK/class_candera_1_1_renderer.html#aaf7f7ac9ec4402c24c70bcd04fd0bfa1)), to activate a clear mode (Renderer::ActivateClearMode), and scissor (Renderer::ActivateScissor).

<div class="contents" id="bkmrk-"><div class="contents"><div class="textblock">---

</div></div></div>#### Dirty Area Management

[Renderer::RenderCamera](http://dev.doc.cgistudio.at/APILINK/class_candera_1_1_renderer.html#a10dbe66b15c60f44cce3aaccd38d2ee5) now accepts a rectangle as the parameter that defines a dirty area. A dirty area denotes an area on the screen or render target in which the content has changed, thus only this area requires updating by the [Renderer](http://dev.doc.cgistudio.at/APILINK/class_candera_1_1_renderer.html "The class Renderer represents the unique Candera render interface to the application. Each render call an base of Candera shall be triggered via the Renderer interface."). The dirty area rectangle parameter defaults to the full size of the screen or render target. If the user provides his own dirty area rectangle, only this area will be cleared and drawn to. Objects whose bounding rectangle is outside the dirty area will be skipped. Generally speaking, the smaller the dirty area, the smaller the bandwidth required for clearing and drawing, and the more objects can be skipped.

This feature also adds the properties [Renderer::Statistics::CulledNodesUsingDirtyAreaScissor](http://dev.doc.cgistudio.at/APILINK/struct_candera_1_1_renderer_1_1_statistics.html#a15baae47c2e48398d527823f402b0e93 "Number of nodes culled due to their bounding box being outside the dirty area.") and [Renderer::Statistics::AverageDirtyAreaFactor](http://dev.doc.cgistudio.at/APILINK/struct_candera_1_1_renderer_1_1_statistics.html#a2ef679fb55bffe7c2a42e36924779ee0 "Average dirty area factor (dirty area / renderTarget area) in the range of (0..1]."). CulledNodesUsingDirtyAreaScissor denotes the number of objects that could be skipped by the [Renderer](http://dev.doc.cgistudio.at/APILINK/class_candera_1_1_renderer.html "The class Renderer represents the unique Candera render interface to the application. Each render call an base of Candera shall be triggered via the Renderer interface.") due to their bounding rectangle being outside the dirty area. AverageDirtyAreaFactor denotes the average dirty area divided by the size of the screen or render target. E.g. a factor of 0.8 means that the average dirty area accumulated since the last [Renderer::Statistics::Reset](http://dev.doc.cgistudio.at/APILINK/struct_candera_1_1_renderer_1_1_statistics.html#abb63e5922adbe34593df495ed2694294) is 80% of the size of the screen or render target. The bigger the factor, the less performance improvement can be expected. Under some circumstances, which depends on the actual content being used, performance can even decrease. Therefore always profile this feature to see if your content benefits from it or not.

<div class="contents" id="bkmrk--0"><div class="contents"><div class="textblock">---

</div></div></div>#### New Renderer::Statistics properties

[Renderer::Statistics](http://dev.doc.cgistudio.at/APILINK/struct_candera_1_1_renderer_1_1_statistics.html) now also exposes the number of color buffer, depth buffer, and stencil buffer clears, as well as the number of nodes that were culled due to using a dirty area, and the ratio of the average dirty area to its screen/render target area.

<div class="contents" id="bkmrk--1"><div class="contents"><div class="textblock">---

</div></div></div>#### CanvasGroup::TranslatePivot renamed

[CanvasGroup::TranslatePivot](http://dev.doc.cgistudio.at/APILINK/class_candera_1_1_group.html#a593b45667010200bd4e35f75dbaf182d) has been renamed to [CanvasGroup::TranslatePivot2D](http://dev.doc.cgistudio.at/APILINK/class_candera_1_1_canvas_group.html#a029decdb2d21ed93464b08e81547922e).

<div class="contents" id="bkmrk--2"><div class="contents"><div class="textblock">---

</div></div></div>#### PlanarShadow::GetId and SetId renamed

[PlanarShadow::GetId](http://dev.doc.cgistudio.at/APILINK/class_candera_1_1_candera_object.html#a8f0f015836c983726e590472024816aa) has been renamed to [PlanarShadow::GetStencilBufferId](http://dev.doc.cgistudio.at/APILINK/class_candera_1_1_planar_shadow.html#abdfe7d5274e03d6b40c42e483c5a8c97). In the same manner also [PlanarShadow::SetStencilBufferId](http://dev.doc.cgistudio.at/APILINK/class_candera_1_1_planar_shadow.html#a4c748372ea9c301632bd0a2af9a20a34).

<div class="contents" id="bkmrk--3"><div class="contents"><div class="textblock">---

</div></div></div>#### Camera Look-At Node

A new feature allows to set a look-at node for a camera. If such a node is set the camera will always look at that node.

<div class="contents" id="bkmrk-see-also%3A-camera%3A%3Ase"><div class="contents"><div class="textblock"><dl class="see"><dt>**See also:**</dt><dd>[Camera::SetLookAtNode](http://dev.doc.cgistudio.at/APILINK/class_candera_1_1_camera.html#a53b1e4854b4c8b15369b82facb560c07).</dd></dl>---

</div></div></div>#### Normalize Rectangle from Render Target Space

A new function to normalize a given rectangle from the render target space has been added.

<div class="contents" id="bkmrk-see-also%3A-math3d%3A%3Ano"><div class="textblock"><dl class="see"><dt>**See also:**</dt><dd>[Math3D::NormalizeRectangle()](http://dev.doc.cgistudio.at/APILINK/class_candera_1_1_math3_d.html#a5acae572700c94a5e8e898d71addb30f).</dd></dl></div></div>---