Loading [MathJax]/extensions/TeX/AMSmath.js
Radium Engine  1.5.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
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 () override
 
 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
const std::string & getInstanceName () const
 
const std::string & getMaterialName () const
 
void setMaterialAspect (const MaterialAspect &aspect)
 
const MaterialAspectgetMaterialAspect () const
 
virtual bool isTransparent () const
 
std::list< std::string > getPropertyList () const override
 
virtual void setColoredByVertexAttrib (bool)
 Makes the Material take its base color from the VERTEX_COLOR attribute of the rendered geometry. More...
 
virtual bool isColoredByVertexAttrib () const
 Indicates if the material takes the VERTEX_COLOR attribute into account.
 
void needUpdate ()
 
- 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 }
 
- Protected Member Functions inherited from Ra::Engine::Data::Material
 Material (const std::string &instanceName, const std::string &materialName, MaterialAspect aspect=MaterialAspect::MAT_OPAQUE)
 
void setMaterialName (std::string newName)
 
- Protected Attributes inherited from Ra::Engine::Data::Material
std::string m_instanceName {}
 Material instance name.
 
MaterialAspect m_aspect { MaterialAspect::MAT_OPAQUE }
 Material aspect.
 
bool m_isDirty { true }
 

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

Destructor.

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 168 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 164 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: