Radium Engine
1.5.20
|
Rendering in Radium is managed by the abstract Ra::Engine::Rendering::Renderer class that provides the following main rendering method.
This method is general and cannot be modified, it always does the following
The meaning of each rendering steps is described below.
In some cases (like with QtOpenGLWidget
), you do not draw directly on the screen, but you have instead to feed an already bound FBO. Since the default renderer uses multiple FBOs, the Qt's one must be saved.
This behaviour cannot be modified.
This construct the set of objects that must be drawn for the current frame and update their OpenGL state.
This construct the set of render actions that must be done for the current frame.
If there has been some picking requests since the last frame, doPicking
is called. This function just renders all the objects (except debug ones) by drawing them in some color given the ID of the entity a render object is attached to.
Then, for each picking request done, glReadPixels
is called at the requested location, and object ID is retrieved.
This method does most of the whole rendering work and outputs one final render pass texture, ready to be post-processed.
This method will apply post-processing filters on the computed image.
To define a concrete renderer, the Ra::Engine::Rendering::Renderer class can be inherited to define, at least, the renderInternal
method. Note that only two methods can be overridden for the renderer, renderInternal (step 4) and postProcessInternal (step 5).
A concrete renderer will build its rendering loop, the renderInternal
method, by decomposing it into passes configured, for each Ra::engine::RenderObject, using the Ra::Engine::Rendering::RenderTechique class.
A Ra::Engine::Rendering::RenderTechnique consists in a set of named Ra::Engine::Data::ShaderConfiguration that provide the GLSL code used by each pass to compute the appearance of a Ra::Engine::Rendering::RenderObject and a set of Ra::Engine::Data::ShaderParameterProvider that provide shader data to be used for each pass.
When rendering, the renderer will loop over all the configured Ra::Engine::Rendering::RenderObject and, for each rendering pass, will get the OpenGL pipeline configuration and parameters from the Ra::Engine::Rendering::RenderTechnique associated with the Ra::Engine::Rendering::RenderObject.
The Radium Engine exports a ready to use renderer, Ra::Engine::Rendering::ForwardRenderer, that decomposes the rendering into three passes as described in the Forward Render document.
This section explain, through the developement of a simple Rendering, how to configure RenderObjects and RenderTechnique to be used by a renderer.
Help wanted for this section.
Help wanted for this section.
See Material management documentation for a complete description of the interactions geometry, material and shader._