RenderTarget


RenderTarget This node provides a render target which saves the render output and provides it as a texture.
RenderTarget Reference This node provides the possibility to reuse a render target and additionally write different render outputs to one single render target.

A RenderTarget node is used to render all following nodes in the scene hierarchy into a texture instead of the screen. The RenderTargets output texture can be used like any other texture and is the basis for creating special effects such as Glow, Blur.

Use of RenderTargets is currently not supported by the intersection handling that is required for using any of the Interaction Nodes.


Texture Resolution and Quality

A RenderTargets texture resolution can be defined in Width and Height in addition to the multisampling quality of the texture. The default resolution settings for a RenderTarget texture is the current renderer window resolution. In Viewport size mode the Rendertarget is created in the size of the parent Viewport. The values of the final Rendertarget resolution are available as output properties TextureWidth and TextureHeight.

Try to keep the number of RenderTarget Nodes and their respective resolution to a minimum. They consume a substantial amount of graphics card memory and switches between them are one of the most expensive rendering operations there is.


Although the width/height properties list only multiples of two, it is possible to set a RenderTarget to arbitrary values by using an Integer node and binding it to the width/height properties. Note however that the maximum texture size restrictions of the graphics card still apply. In most cases 16k pixels width or height is the maximum modern graphics cards can handle.


To reduce the amount of alias ("pixelation") when doing any rendering (whether into a texture or onto the screen), graphics cards can render in a higher resolution internally and the re-sample down to the target resolution. This process is called Multisampling, sometimes referred to as anti-aliasing. There are three places the multisampling quality can be specified:


Ventuz defines the following quality settings:

If the whole scene is rendered into a RenderTarget and that texture is simply mapped to the screen via an Overlay Rectangle, multi-sampling should be activated in the RenderTarget and deactivated in the Project Properties. Multi-sampling the rendering to the screen when the Texture is already multi-sampled would only unnecessarily increase memory consumption and decrease render performance because textures (in our case the render target) are not multisampled at all! Only edges of geometries are affected!

Sharing and Referencing

To save graphics card memory and improve performance, the memory allocated by a RenderTarget node can be shared by assigning a common ShareID different than -1 to all RenderTargets that should share a texture. RenderTarget sharing only works if the according RenderTarget nodes match in all parameters (like size and multisampling quality). The ShareID technique allows sharing of render targets across different scenes as long the size and multisampling settings of the shared render targets are equal.

The following example shows two RenderTarget Nodes that share the same memory. Since the output texture of Target1 is used before Target2 is reached in the render order, Target2 can clear and re-use the same memory without any visual difference to using two separate RenderTargets. To avoid clearing the content of a shared render target use a Viewport node as the first node behind the render target and disable all clear options of it.


An second way of sharing render target is via the Render Target Reference node. This node can only be used within the same scene tree and shares the actual render target via Binding. The property RenderTarget has to be bound to the Texture output Property of the actual Render Target node. This technique is less error prone as there is no chance to assign different sizes or multisampling options.


Each RenderTarget node will clear the output texture before rendering the first piece of geometry to the texture. The Render Target Reference will however not clear the texture. Therefore the content below the reference will be added to the output texture.

The Render Target Reference node is a simplified way to share render targets within the same scene whereas the ShareID technique can be used for cross-scene sharing. If a scene is loaded, its render targets by default will occupy GPU memory regardless of whether or not the scene is currently rendered. By using share IDs, scenes can share a single GPU render target without any conflicts as long as only one of them is active and therefore uses the render target.


Advanced Properties

A RenderTarget can be told to not create a depth buffer when allocating its internal data structure by removing the check mark of the DepthStencilCreate property. This saves memory but puts all responsibility for handling overdraw of objects on the user. So called shared depth buffers can be used for special effects such as glow or bloom shaders. A depth buffers can only be reused if

  1. its size (width and height) matches the requested size of the rendertarget, and
  2. the multisampling settings are the same.

If these conditions are not fulfilled, the rendertarget node will create a new depth/stencil buffer regardless of the value of the DepthStencilCreate property.

The AutoMipMap property specifies if texture MipMaps should be created automatically during rendering. This is useful if the rendertarget texture is applied to a geometry which will be moved and rotated in 3D space.

The OptionsFormat property defines the format or numeric layout of the Rendertarget in the graphics board memory. Other formats than ARGB 8 bit are useful if one writes custom Shader to create special rendering effects. In Default mode the format is taken from the Outputs settings in the Audio Video Configuration.

The ScreenAligned property has only effect if a Render Setup configuration with more than one machine is active. It can have three states: Inherit, Yes and No. In Multi-Machine Rendering it specifies if a machine should render the complete scene to the rendertarget (No) or only the part of the scene wihch should be displayed on the current machine according to the Render Setup configuration (Yes). In case of Inherit a parent node defines the state.