Radium Engine  1.5.0
Ra::Engine::Rendering::RenderTechnique Class Referencefinal

#include <Engine/Rendering/RenderTechnique.hpp>

+ Collaboration diagram for Ra::Engine::Rendering::RenderTechnique:

Public Member Functions

 RenderTechnique (const RenderTechnique &)
 copy constuctor, only active pass and active pass parameters are copied.
 
void setConfiguration (const Data::ShaderConfiguration &newConfig, Core::Utils::Index pass=DefaultRenderingPasses::LIGHTING_OPAQUE)
 
bool hasConfiguration (Core::Utils::Index pass=DefaultRenderingPasses::LIGHTING_OPAQUE) const
 
void setConfiguration (Core::Utils::Index pass=DefaultRenderingPasses::LIGHTING_OPAQUE)
 
void clearConfiguration (Core::Utils::Index pass=DefaultRenderingPasses::LIGHTING_OPAQUE)
 
const Data::ShaderConfigurationgetConfiguration (Core::Utils::Index pass=DefaultRenderingPasses::LIGHTING_OPAQUE) const
 
const Data::ShaderProgramgetShader (Core::Utils::Index pass=DefaultRenderingPasses::LIGHTING_OPAQUE) const
 
void setParametersProvider (std::shared_ptr< Data::ShaderParameterProvider > provider, Core::Utils::Index pass=Core::Utils::Index(-1))
 
const Data::ShaderParameterProvidergetParametersProvider (Core::Utils::Index pass=DefaultRenderingPasses::LIGHTING_OPAQUE) const
 
void updateGL ()
 
bool isDirty (Core::Utils::Index pass=DefaultRenderingPasses::LIGHTING_OPAQUE) const
 
void setDirty (Core::Utils::Index pass=DefaultRenderingPasses::LIGHTING_OPAQUE)
 
void clearDirty (Core::Utils::Index pass=DefaultRenderingPasses::LIGHTING_OPAQUE)
 
void addPassProperties (const std::list< std::string > &props, Core::Utils::Index pass=Core::Utils::Index {})
 

Static Public Member Functions

static RenderTechnique createDefaultRenderTechnique ()
 

Detailed Description

Set of shaders to be used by the renderer to render objects with associated data.

See also
Render technique and materials section in the Material management in the Radium Engine documentation

Definition at line 63 of file RenderTechnique.hpp.

Member Function Documentation

◆ addPassProperties()

void Ra::Engine::Rendering::RenderTechnique::addPassProperties ( const std::list< std::string > &  props,
Core::Utils::Index  pass = Core::Utils::Index {} 
)

Add properties (several #define in the shader) for the given pass

Parameters
propsthe properties list, only strings without the #define
passthe pass. If left by default, all active passes will get the properties

Definition at line 71 of file RenderTechnique.cpp.

+ Here is the call graph for this function:

◆ clearConfiguration()

void Ra::Engine::Rendering::RenderTechnique::clearConfiguration ( Core::Utils::Index  pass = DefaultRenderingPasses::LIGHTING_OPAQUE)
inline

Mark the given not configured.

Parameters
passThe index of the pass

Definition at line 269 of file RenderTechnique.hpp.

◆ clearDirty()

void Ra::Engine::Rendering::RenderTechnique::clearDirty ( Core::Utils::Index  pass = DefaultRenderingPasses::LIGHTING_OPAQUE)
inline

Clear the dirty bit for the given pass (openGL state updated)

Parameters
passThe index of the pass

Definition at line 257 of file RenderTechnique.hpp.

◆ createDefaultRenderTechnique()

RenderTechnique Ra::Engine::Rendering::RenderTechnique::createDefaultRenderTechnique ( )
static

Creates a default technique based on the ForwarRenderer sementic. pass 1 --> Z_PREPASS pass 0 --> LIGHTING_OPAQUE pass 2 --> LIGHTING_TRANSPARENT

Returns
the default technique

Definition at line 115 of file RenderTechnique.cpp.

◆ getConfiguration()

const Data::ShaderConfiguration & Ra::Engine::Rendering::RenderTechnique::getConfiguration ( Core::Utils::Index  pass = DefaultRenderingPasses::LIGHTING_OPAQUE) const
inline

Get the configuration of the given pass

Parameters
passThe index of the pass
Returns
The pass shader configuration

Definition at line 274 of file RenderTechnique.hpp.

◆ getParametersProvider()

const Data::ShaderParameterProvider * Ra::Engine::Rendering::RenderTechnique::getParametersProvider ( Core::Utils::Index  pass = DefaultRenderingPasses::LIGHTING_OPAQUE) const

Get the Data::ShaderProgram parameters associated with the pass

Parameters
passThe index of the pass
Returns
The pass Data::ShaderParameterProvider if the pass is configured, nullptr otherwise.

Definition at line 93 of file RenderTechnique.cpp.

+ Here is the call graph for this function:

◆ getShader()

const Data::ShaderProgram * Ra::Engine::Rendering::RenderTechnique::getShader ( Core::Utils::Index  pass = DefaultRenderingPasses::LIGHTING_OPAQUE) const

Get the Data::ShaderProgram associated with the pass

Parameters
passThe index of the pass
Returns
The pass shader program if the pass is configured, nullptr otherwise.

Definition at line 46 of file RenderTechnique.cpp.

+ Here is the call graph for this function:

◆ hasConfiguration()

bool Ra::Engine::Rendering::RenderTechnique::hasConfiguration ( Core::Utils::Index  pass = DefaultRenderingPasses::LIGHTING_OPAQUE) const
inline

Test if the given pass was configured

Parameters
passThe index of the pass
Returns
true if the pass was configured

Definition at line 261 of file RenderTechnique.hpp.

◆ isDirty()

bool Ra::Engine::Rendering::RenderTechnique::isDirty ( Core::Utils::Index  pass = DefaultRenderingPasses::LIGHTING_OPAQUE) const
inline

Test if the given pass is dirty (openGL state not updated)

Parameters
passThe index of the pass
Returns
Tru if pass must be updated.

Definition at line 245 of file RenderTechnique.hpp.

◆ setConfiguration() [1/2]

void Ra::Engine::Rendering::RenderTechnique::setConfiguration ( const Data::ShaderConfiguration newConfig,
Core::Utils::Index  pass = DefaultRenderingPasses::LIGHTING_OPAQUE 
)

Set the shader configuration for the given pass. m_numActivePass is updated to be the max of all indices that are set this way.

Parameters
newConfigThe pass shader configuration
passThe index of the pass to set

Definition at line 38 of file RenderTechnique.cpp.

+ Here is the call graph for this function:

◆ setConfiguration() [2/2]

void Ra::Engine::Rendering::RenderTechnique::setConfiguration ( Core::Utils::Index  pass = DefaultRenderingPasses::LIGHTING_OPAQUE)
inline

Mark the given configured.

Parameters
passThe index of the pass

Definition at line 265 of file RenderTechnique.hpp.

◆ setDirty()

void Ra::Engine::Rendering::RenderTechnique::setDirty ( Core::Utils::Index  pass = DefaultRenderingPasses::LIGHTING_OPAQUE)
inline

Set the given pass dirty (openGL state not updated)

Parameters
passThe index of the pass

Set the given pass dirty (openGL state updated)

Parameters
passThe index of the pass

Definition at line 253 of file RenderTechnique.hpp.

◆ setParametersProvider()

void Ra::Engine::Rendering::RenderTechnique::setParametersProvider ( std::shared_ptr< Data::ShaderParameterProvider provider,
Core::Utils::Index  pass = Core::Utils::Index( -1 ) 
)

Set the shader parameter provider for the given pass.

Note
all passes must be configured first using RenderTechnique::setConfiguration() before setting the parameter provider for each pass.
Parameters
providerThe rendering parameter provider
passThe index of the pass to set. If this -1, all active passes will share the same provider.

Definition at line 51 of file RenderTechnique.cpp.

+ Here is the call graph for this function:

◆ updateGL()

void Ra::Engine::Rendering::RenderTechnique::updateGL ( )

Update all openGL status of active passes.

Definition at line 98 of file RenderTechnique.cpp.

+ Here is the call graph for this function:

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