Render View System
Render views are used in order to allow offscreen renderings, post-process effects, rendering to several windows …
A Render view is the association of
- A render target
The render target is the surface where the scene will be rendered. This can be a texture, the back buffer of a swap chain …
- A viewport
The viewport is the 2D rectangle into which the rendering is made.
- Something to render
The Render view can render
- A scene graph using specific parameters
- A 2D quad in order to make a post process effect
There are different kinds of Render views:
- Scene graph render views
Used to render the scene graph into a render target.
- Scene graph shadow map render views
Used to create a shadow map from a light of the scene.
- Post process render views
Used to apply a 2D post-process or screen space effect.
Render views are organized into a tree in order to ensure that the children are rendered before the parents. Thus, the parents can use the results of the children (render target textures for instance).
The following diagram is an example of Render view graph and should be read from the bottom to the top. It represents the graph used to render a 3D scene with shadow mapping and a water effect using both a reflection and refraction map.
First, the shadow map render view renders the scene from the light point of view in a texture using a shadow map generation shader.
Then, two post-process render views are used to blur the shadow map.
The blurred result shadow map is used by both a reflection and refraction render views. The reflection render view renders the scene visible from the reflection of the water while the refraction render view renders the underwater.
The main renderview uses the reflection and refraction render views in a water shader for the water rendering but also uses the blurred shadow map (even if it is not a direct child of the node).