Radium Engine
1.5.20
|
The main renderer of Radium, implemented in the class Ra::Engine::Rendering::ForwardRenderer implements a Z-pre-pass forward rendering loop. Even if the material association to a drawable object, realized by the so called Ra::Engine::Rendering::RenderTechnique is tightly coupled with the main rendering loop, Plugins might define new renderers and interact differently with shader and materials properties (see chapter on Materials ).
Here is a summary of the different passes of the Ra::Engine::Rendering::ForwardRenderer
This pass
In this pass, each Ra::Engine::Rendering::RenderObject is drawn with the Ra::Engine::Rendering::Z_PREPASS argument so that the corresponding shader (if it exists) will be activated before draw call. (ro->render( renderParameters, viewingParameters, DefaultRenderingPasses::Z_PREPASS );
)
Note that the shader associated to the Ra::Engine::Rendering::Z_PREPASS pass must draw only fully opaque fragments. Fully transparent ones (rejected by a masking information such as mask texture) and blend-able ones (those with an opacity factor alpha les than one) must be discarded.
This pass is a classic forward lighting pass that accumulates the color of each light source. Before this pass, blending (one, one) is enabled and it does
In this pass, each RenderObject drawn with the Ra::Engine::Rendering::LIGHTING_OPAQUE argument so that the corresponding shader will be activated before draw call. (ro->render( renderParameters, viewingParameters, DefaultRenderingPasses::LIGHTING_OPAQUE );
)
Note that the shader associated to the Ra::Engine::Rendering::LIGHTING_OPAQUE pass must lit and draw only fully opaque fragments. Fully transparent ones (rejected by a masking information such as mask texture) and blend-able ones (those with an opacity factor alpha les than one) must be discarded.
Rendering transparent objects in Radium is done according to the algorithm described in
This pass contains one scene rendering pass and one composition pass.
This pass takes the color buffer, representing colors in linear RGB space) and apply gamma correction to the image
Those objects are drawn with their own shader, and without lighting. They do not write in the depth map but they have different depth testing behaviour :
LESS
for debug objects (drawn only if visible)ALWAYS
for UI objects (drawn in front of everything else)This method is just responsible for displaying the final stuff on screen or on the saved FBO.