Radium Engine  1.5.20
Loading...
Searching...
No Matches
Ra::Engine::Rendering::ForwardRenderer Class Reference

#include <Engine/Rendering/ForwardRenderer.hpp>

+ Inheritance diagram for Ra::Engine::Rendering::ForwardRenderer:
+ Collaboration diagram for Ra::Engine::Rendering::ForwardRenderer:

Public Member Functions

std::string getRendererName () const override
 Get the name of the renderer, e.g to be displayed in the UI.
 
bool buildRenderTechnique (RenderObject *ro) const override
 
- Public Member Functions inherited from Ra::Engine::Rendering::Renderer
 Renderer ()
 
const TimerDatagetTimerData () const
 
Data::TexturegetDisplayTexture () const
 
void lockRendering ()
 
void unlockRendering ()
 
void toggleWireframe ()
 
void enableWireframe (bool enabled)
 
void toggleDrawDebug ()
 
void enableDebugDraw (bool enabled)
 
void enablePostProcess (bool enabled)
 
void render (const Data::ViewingParameters &renderData)
 Tell the renderer it needs to render. This method does the following steps :
 
void initialize (uint width, uint height)
 Initialize renderer.
 
void resize (uint width, uint height)
 Resize the viewport and all the screen textures, fbos. This function must be overrided as soon as some FBO or screensized texture is used (since the default implementation just resizes its own fbos / textures)
 
void addPickingRequest (const PickingQuery &query)
 
const std::vector< PickingResult > & getPickingResults () const
 
const std::vector< PickingQuery > & getPickingQueries () const
 
void setMousePosition (const Core::Vector2 &pos)
 
void setBrushRadius (Scalar brushRadius)
 
bool hasLight () const
 Tell if the renderer has an usable light.
 
void setBackgroundColor (const Core::Utils::Color &color)
 Update the background color (does not trigger a redraw)
 
const Core::Utils::ColorgetBackgroundColor () const
 
virtual void addLight (const Scene::Light *light)
 
virtual void reloadShaders ()
 
virtual void displayTexture (const std::string &texName)
 Change the texture that is displayed on screen. Set m_displayedIsDepth to true if depth linearization is wanted.
 
virtual std::vector< std::stringgetAvailableTextures () const
 Return the names of renderer available textures.
 
int buildAllRenderTechniques () const
 
virtual std::unique_ptr< uchar[]> grabFrame (size_t &w, size_t &h) const
 
PickingResult doPickingNow (const PickingQuery &query, const Data::ViewingParameters &renderData)
 

Protected Types

enum  RendererTextures {
  RendererTextures_Depth = 0 , RendererTextures_HDR , RendererTextures_Normal , RendererTextures_Diffuse ,
  RendererTextures_Specular , RendererTextures_OITAccum , RendererTextures_OITRevealage , RendererTextures_Volume ,
  RendererTexture_Count
}
 
using WireMap = std::map<RenderObject*, std::shared_ptr<Data::Displayable>>
 
- Protected Types inherited from Ra::Engine::Rendering::Renderer
using RenderObjectPtr = std::shared_ptr<RenderObject>
 

Protected Member Functions

void initializeInternal () override
 initializeInternal Initialize the renderer dependant resources.
 
void resizeInternal () override
 
void updateStepInternal (const Data::ViewingParameters &renderData) override
 
void postProcessInternal (const Data::ViewingParameters &renderData) override
 Do all post processing stuff. If you override this method, be careful to fill.
 
void renderInternal (const Data::ViewingParameters &renderData) override
 All the scene rendering magics basically happens here.
 
void debugInternal (const Data::ViewingParameters &renderData) override
 Add the debug layer with useful informations.
 
void uiInternal (const Data::ViewingParameters &renderData) override
 Draw the UI data.
 
virtual void renderBackground (const Data::ViewingParameters &)
 Draw the picture background. This method allows custom renderers to draw objects on the background. Called before the Zpre-pass, but after clearing the draw buffers.
 
- Protected Member Functions inherited from Ra::Engine::Rendering::Renderer

Protected Attributes

std::array< std::string, RendererTexture_Count > m_textureNames
 
std::unique_ptr< globjects::Framebuffer > m_fbo
 
std::unique_ptr< globjects::Framebuffer > m_postprocessFbo
 
std::unique_ptr< globjects::Framebuffer > m_oitFbo
 
std::unique_ptr< globjects::Framebuffer > m_uiXrayFbo
 
std::unique_ptr< globjects::Framebuffer > m_volumeFbo
 
std::vector< RenderObjectPtrm_transparentRenderObjects
 
size_t m_fancyTransparentCount { 0 }
 
std::vector< RenderObjectPtrm_volumetricRenderObjects
 
size_t m_fancyVolumetricCount { 0 }
 
size_t m_pingPongSize { 0 }
 
std::array< std::unique_ptr< Data::Texture >, RendererTexture_Count > m_textures
 
std::vector< std::shared_ptr< Data::Texture > > m_shadowMaps
 
std::vector< Core::Matrix4 > m_lightMatrices
 
WireMap m_wireframes
 
- Protected Attributes inherited from Ra::Engine::Rendering::Renderer
uint m_width { 0 }
 
uint m_height { 0 }
 
Data::ShaderProgramManagerm_shaderProgramManager { nullptr }
 
RenderObjectManager * m_renderObjectManager { nullptr }
 
Data::Texturem_displayedTexture { nullptr }
 The texture that will be displayed on screen. If no call to.
 
std::vector< Ra::Engine::Scene::LightManager * > m_lightmanagers
 
bool m_renderQueuesUpToDate { false }
 
std::vector< RenderObjectPtrm_fancyRenderObjects
 
std::vector< RenderObjectPtrm_debugRenderObjects
 
std::vector< RenderObjectPtrm_xrayRenderObjects
 
std::vector< RenderObjectPtrm_uiRenderObjects
 
std::unique_ptr< Data::Displayablem_quadMesh
 
bool m_drawDebug { true }
 
bool m_wireframe { false }
 
bool m_postProcessEnabled { true }
 
std::unique_ptr< Data::Texturem_depthTexture
 Depth texture : might be attached to the main framebuffer.
 
std::unique_ptr< Data::Texturem_fancyTexture
 Final color texture : might be attached to the main framebuffer.
 
std::map< std::string, Data::Texture * > m_secondaryTextures
 Textures exposed in the texture section box to be displayed.
 

Static Protected Attributes

static const size_t ShadowMapSize { 1024 }
 

Additional Inherited Members

- Public Types inherited from Ra::Engine::Rendering::Renderer
enum  PickingMode {
  RO = 0 , VERTEX , EDGE , TRIANGLE ,
  C_VERTEX , C_EDGE , C_TRIANGLE , NONE
}
 
enum  PickingPurpose { SELECTION = 0 , MANIPULATION }
 

Detailed Description

Default renderer for the Radium Engine This classe implements aforward rendering algorithm with Z-prepass, multipass light accumulation for opaque and transperent objects. Once renderer, the final is composited with Ui, debug and X-ray objects renderings on demand.

See also
rendering.md for description of the renderer

Definition at line 23 of file ForwardRenderer.hpp.

Member Typedef Documentation

◆ WireMap

Member Enumeration Documentation

◆ RendererTextures

enum Ra::Engine::Rendering::ForwardRenderer::RendererTextures
protected

Definition at line 55 of file ForwardRenderer.hpp.

Constructor & Destructor Documentation

◆ ForwardRenderer()

Ra::Engine::Rendering::ForwardRenderer::ForwardRenderer ( )

Definition at line 52 of file ForwardRenderer.cpp.

Member Function Documentation

◆ buildRenderTechnique()

bool Ra::Engine::Rendering::ForwardRenderer::buildRenderTechnique ( RenderObject * ro) const
overridevirtual

Define, for the given render object, the render technique cooresponding to the renderer.

Parameters
rothe render object to modofy
Returns
True if the renderTechnique was defined.

Implements Ra::Engine::Rendering::Renderer.

Definition at line 686 of file ForwardRenderer.cpp.

+ Here is the call graph for this function:

◆ debugInternal()

void Ra::Engine::Rendering::ForwardRenderer::debugInternal ( const Data::ViewingParameters & renderData)
overrideprotectedvirtual

Add the debug layer with useful informations.

Implements Ra::Engine::Rendering::Renderer.

Definition at line 489 of file ForwardRenderer.cpp.

+ Here is the call graph for this function:

◆ getRendererName()

std::string Ra::Engine::Rendering::ForwardRenderer::getRendererName ( ) const
inlineoverridevirtual

Get the name of the renderer, e.g to be displayed in the UI.

Returns

Implements Ra::Engine::Rendering::Renderer.

Definition at line 29 of file ForwardRenderer.hpp.

◆ initializeInternal()

void Ra::Engine::Rendering::ForwardRenderer::initializeInternal ( )
overrideprotectedvirtual

initializeInternal Initialize the renderer dependant resources.

Implements Ra::Engine::Rendering::Renderer.

Definition at line 56 of file ForwardRenderer.cpp.

◆ postProcessInternal()

void Ra::Engine::Rendering::ForwardRenderer::postProcessInternal ( const Data::ViewingParameters & renderData)
overrideprotectedvirtual

Do all post processing stuff. If you override this method, be careful to fill.

See also
m_fancyTexture since it is the texture that will be displayed at the very end of the
render method.
Parameters
renderDataThe basic data needed for the rendering : Time elapsed since last frame, camera view matrix, camera projection matrix.

Implements Ra::Engine::Rendering::Renderer.

Definition at line 569 of file ForwardRenderer.cpp.

+ Here is the call graph for this function:

◆ renderBackground()

virtual void Ra::Engine::Rendering::ForwardRenderer::renderBackground ( const Data::ViewingParameters & )
inlineprotectedvirtual

Draw the picture background. This method allows custom renderers to draw objects on the background. Called before the Zpre-pass, but after clearing the draw buffers.

Definition at line 53 of file ForwardRenderer.hpp.

◆ renderInternal()

void Ra::Engine::Rendering::ForwardRenderer::renderInternal ( const Data::ViewingParameters & renderData)
overrideprotectedvirtual

All the scene rendering magics basically happens here.

Parameters
renderDataThe basic data needed for the rendering : Time elapsed since last frame, camera view matrix, camera projection matrix.
Todo
make offset relative to wireframe line width
Todo
use globjects.

Implements Ra::Engine::Rendering::Renderer.

Definition at line 238 of file ForwardRenderer.cpp.

+ Here is the call graph for this function:

◆ resizeInternal()

void Ra::Engine::Rendering::ForwardRenderer::resizeInternal ( )
overrideprotectedvirtual

resize the renderer dependent resources

Implements Ra::Engine::Rendering::Renderer.

Definition at line 590 of file ForwardRenderer.cpp.

+ Here is the call graph for this function:

◆ uiInternal()

void Ra::Engine::Rendering::ForwardRenderer::uiInternal ( const Data::ViewingParameters & renderData)
overrideprotectedvirtual

Draw the UI data.

Implements Ra::Engine::Rendering::Renderer.

Definition at line 523 of file ForwardRenderer.cpp.

◆ updateStepInternal()

void Ra::Engine::Rendering::ForwardRenderer::updateStepInternal ( const Data::ViewingParameters & renderData)
overrideprotectedvirtual

Update the renderer dependent resources for the next frame

Parameters
renderData

Implements Ra::Engine::Rendering::Renderer.

Definition at line 131 of file ForwardRenderer.cpp.

Member Data Documentation

◆ m_fancyTransparentCount

size_t Ra::Engine::Rendering::ForwardRenderer::m_fancyTransparentCount { 0 }
protected

Definition at line 83 of file ForwardRenderer.hpp.

◆ m_fancyVolumetricCount

size_t Ra::Engine::Rendering::ForwardRenderer::m_fancyVolumetricCount { 0 }
protected

Definition at line 86 of file ForwardRenderer.hpp.

◆ m_fbo

std::unique_ptr<globjects::Framebuffer> Ra::Engine::Rendering::ForwardRenderer::m_fbo
protected

Definition at line 76 of file ForwardRenderer.hpp.

◆ m_lightMatrices

std::vector<Core::Matrix4> Ra::Engine::Rendering::ForwardRenderer::m_lightMatrices
protected

Definition at line 94 of file ForwardRenderer.hpp.

◆ m_oitFbo

std::unique_ptr<globjects::Framebuffer> Ra::Engine::Rendering::ForwardRenderer::m_oitFbo
protected

Definition at line 78 of file ForwardRenderer.hpp.

◆ m_pingPongSize

size_t Ra::Engine::Rendering::ForwardRenderer::m_pingPongSize { 0 }
protected

Definition at line 88 of file ForwardRenderer.hpp.

◆ m_postprocessFbo

std::unique_ptr<globjects::Framebuffer> Ra::Engine::Rendering::ForwardRenderer::m_postprocessFbo
protected

Definition at line 77 of file ForwardRenderer.hpp.

◆ m_shadowMaps

std::vector<std::shared_ptr<Data::Texture> > Ra::Engine::Rendering::ForwardRenderer::m_shadowMaps
protected

Definition at line 93 of file ForwardRenderer.hpp.

◆ m_textureNames

std::array<std::string, RendererTexture_Count> Ra::Engine::Rendering::ForwardRenderer::m_textureNames
protected
Initial value:
{ { "Depth (fw)",
"HDR",
"Normal",
"Diffuse",
"Specular",
"OIT Accum",
"OIT Revealage",
"Volume" } }

Definition at line 66 of file ForwardRenderer.hpp.

◆ m_textures

std::array<std::unique_ptr<Data::Texture>, RendererTexture_Count> Ra::Engine::Rendering::ForwardRenderer::m_textures
protected

Definition at line 90 of file ForwardRenderer.hpp.

◆ m_transparentRenderObjects

std::vector<RenderObjectPtr> Ra::Engine::Rendering::ForwardRenderer::m_transparentRenderObjects
protected

Definition at line 82 of file ForwardRenderer.hpp.

◆ m_uiXrayFbo

std::unique_ptr<globjects::Framebuffer> Ra::Engine::Rendering::ForwardRenderer::m_uiXrayFbo
protected

Definition at line 79 of file ForwardRenderer.hpp.

◆ m_volumeFbo

std::unique_ptr<globjects::Framebuffer> Ra::Engine::Rendering::ForwardRenderer::m_volumeFbo
protected

Definition at line 80 of file ForwardRenderer.hpp.

◆ m_volumetricRenderObjects

std::vector<RenderObjectPtr> Ra::Engine::Rendering::ForwardRenderer::m_volumetricRenderObjects
protected

Definition at line 85 of file ForwardRenderer.hpp.

◆ m_wireframes

WireMap Ra::Engine::Rendering::ForwardRenderer::m_wireframes
protected

Definition at line 97 of file ForwardRenderer.hpp.

◆ ShadowMapSize

const size_t Ra::Engine::Rendering::ForwardRenderer::ShadowMapSize { 1024 }
staticprotected

Definition at line 92 of file ForwardRenderer.hpp.


The documentation for this class was generated from the following files: