Radium Engine  1.5.20
Loading...
Searching...
No Matches
Ra::Engine::Data::RawShaderMaterial Class Reference

#include <Engine/Data/RawShaderMaterial.hpp>

+ Inheritance diagram for Ra::Engine::Data::RawShaderMaterial:
+ Collaboration diagram for Ra::Engine::Data::RawShaderMaterial:

Public Member Functions

 RawShaderMaterial (const std::string &instanceName, const std::vector< std::pair< Data::ShaderType, std::string > > &shaders, std::shared_ptr< Data::ShaderParameterProvider > paramProvider)
 
 RawShaderMaterial (const RawShaderMaterial &)=delete
 
Data::RenderParametersgetParameters () override
 
const Data::RenderParametersgetParameters () const override
 
void registerDefaultTechnique ()
 
void updateShaders (const std::vector< std::pair< Data::ShaderType, std::string > > &shaders, std::shared_ptr< Data::ShaderParameterProvider > paramProvider=nullptr)
 
void updateGL () override final
 
- Public Member Functions inherited from Ra::Engine::Data::Material
virtual ~Material ()=default
 
const std::stringgetInstanceName () const
 
const std::stringgetMaterialName () const
 
void setMaterialAspect (const MaterialAspect &aspect)
 
const MaterialAspectgetMaterialAspect () const
 Get the aspect (MAT_OPAQUE or MAT_TRANSPARENT) of the material.
 
virtual bool isTransparent () const
 
std::list< std::stringgetPropertyList () const override
 Get the list of properties the material migh use in a shader.
 
virtual void setColoredByVertexAttrib (bool state)
 Makes the Material take its base color from the VERTEX_COLOR attribute of the rendered geometry.
 
virtual bool isColoredByVertexAttrib () const
 Indicates if the material takes the VERTEX_COLOR attribute into account.
 
void needUpdate ()
 Mark the Material as needing update before the next OpenGL call.
 
- Public Member Functions inherited from Ra::Engine::Data::ShaderParameterProvider
virtual void updateFromParameters ()
 Update the attributes of the ShaderParameterProvider to their actual values stored in the renderParameters.
 

Static Public Member Functions

static void registerMaterial ()
 
static void unregisterMaterial ()
 

Additional Inherited Members

- Public Types inherited from Ra::Engine::Data::Material
enum class  MaterialAspect { MAT_OPAQUE , MAT_TRANSPARENT , MAT_DENSITY }
 Identifies the type of the material. More...
 
- Protected Member Functions inherited from Ra::Engine::Data::Material
 Material (const std::string &instanceName, const std::string &materialName, MaterialAspect aspect=MaterialAspect::MAT_OPAQUE)
 Creates a named material with the given aspect.
 
void setMaterialName (std::string newName)
 Change the material name.
 
bool isDirty ()
 Return dirty state.
 
void setDirty ()
 Set dirty state to true.
 
void setClean ()
 Set dirty state to false.
 

Detailed Description

Definition of the Custom Material to compatible with the Radium Management of RenderObjects/GeometryComponents

Definition at line 73 of file RawShaderMaterial.hpp.

Constructor & Destructor Documentation

◆ RawShaderMaterial() [1/2]

Ra::Engine::Data::RawShaderMaterial::RawShaderMaterial ( const std::string & instanceName,
const std::vector< std::pair< Data::ShaderType, std::string > > & shaders,
std::shared_ptr< Data::ShaderParameterProvider > paramProvider )
explicit

Construct a named material from raw shaders

Parameters
instanceNameThe name of the material instance
shadersThe shaders to use for each pipeline stage (only one source per stage is allowed)
paramProviderThe parameter provider for the resulting program

Definition at line 11 of file RawShaderMaterial.cpp.

+ Here is the call graph for this function:

◆ ~RawShaderMaterial()

Ra::Engine::Data::RawShaderMaterial::~RawShaderMaterial ( )
override

Definition at line 23 of file RawShaderMaterial.cpp.

◆ RawShaderMaterial() [2/2]

Ra::Engine::Data::RawShaderMaterial::RawShaderMaterial ( const RawShaderMaterial & )
delete

RawShaderMaterial is not copyable

Member Function Documentation

◆ getParameters() [1/2]

const Data::RenderParameters & Ra::Engine::Data::RawShaderMaterial::getParameters ( ) const
inlineoverridevirtual

Override of the const getParameters() const method from Material

Returns

Reimplemented from Ra::Engine::Data::ShaderParameterProvider.

Definition at line 164 of file RawShaderMaterial.hpp.

◆ getParameters() [2/2]

Data::RenderParameters & Ra::Engine::Data::RawShaderMaterial::getParameters ( )
inlineoverridevirtual

Override of the getParameters() method from Material

Returns

Reimplemented from Ra::Engine::Data::ShaderParameterProvider.

Definition at line 160 of file RawShaderMaterial.hpp.

◆ registerDefaultTechnique()

void Ra::Engine::Data::RawShaderMaterial::registerDefaultTechnique ( )

Register shader configuration and the ForwardRenderer (default) technique for this instance

Definition at line 37 of file RawShaderMaterial.cpp.

+ Here is the call graph for this function:

◆ registerMaterial()

void Ra::Engine::Data::RawShaderMaterial::registerMaterial ( )
static

Register the material in the material library. After registration, the material could be instantiated by any Radium system, renderer, plugin, ...

Definition at line 62 of file RawShaderMaterial.cpp.

+ Here is the call graph for this function:

◆ unregisterMaterial()

void Ra::Engine::Data::RawShaderMaterial::unregisterMaterial ( )
static

Remove the material from the material library. After removal, the material is no more available, ...

Definition at line 68 of file RawShaderMaterial.cpp.

+ Here is the call graph for this function:

◆ updateGL()

void Ra::Engine::Data::RawShaderMaterial::updateGL ( )
finaloverridevirtual

Update the openGL state of the material. This state also consist in updating the parameter provider of the Material

Implements Ra::Engine::Data::ShaderParameterProvider.

Definition at line 72 of file RawShaderMaterial.cpp.

◆ updateShaders()

void Ra::Engine::Data::RawShaderMaterial::updateShaders ( const std::vector< std::pair< Data::ShaderType, std::string > > & shaders,
std::shared_ptr< Data::ShaderParameterProvider > paramProvider = nullptr )

Update the shaders of the material.

Note
the given shaders array is considered as a remplacement of the current shader array.
Parameters
instanceNameThe name of the material instance
shadersThe shaders to use for each pipeline stage (only one source per stage is allowed)
paramProviderThe parameter provider for the resulting program. If not given, the old provider will be kept.

Definition at line 77 of file RawShaderMaterial.cpp.

+ Here is the call graph for this function:

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