![]() |
Radium Engine
1.6.3
|
Base class for materials. More...
#include <Engine/Data/Material.hpp>
Inheritance diagram for Ra::Engine::Data::Material:
Collaboration diagram for Ra::Engine::Data::Material:Public Types | |
| enum class | MaterialAspect { MAT_OPAQUE , MAT_TRANSPARENT , MAT_DENSITY } |
| Identifies the type of the material. More... | |
Public Member Functions | |
| virtual | ~Material ()=default |
| const std::string & | getInstanceName () const |
| const std::string & | getMaterialName () const |
| void | setMaterialAspect (const MaterialAspect &aspect) |
| const MaterialAspect & | getMaterialAspect () const |
| Get the aspect (MAT_OPAQUE or MAT_TRANSPARENT) of the material. | |
| virtual bool | isTransparent () const |
| std::list< std::string > | getPropertyList () 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 RenderParameters & | getParameters () |
| virtual const RenderParameters & | getParameters () const |
| virtual void | updateGL ()=0 |
| Update the OpenGL states used by the ShaderParameterProvider. | |
| virtual void | updateFromParameters () |
| Update the attributes of the ShaderParameterProvider to their actual values stored in the renderParameters. | |
Protected Member Functions | |
| 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. | |
Base class for materials.
Do not assume a given Material representation but only make the difference between opaque and transparent materials.
Definition at line 23 of file Material.hpp.
|
strong |
Identifies the type of the material.
MAT_OPAQUE and MAT_TRANSPARENT implements the GLSL "surfacic" BSDF interface MAT_DENSITY implements the GLSL "volumetric" interface
| Enumerator | |
|---|---|
| MAT_TRANSPARENT | <- The material is either OPAQUE or TRANSPARENT |
| MAT_DENSITY | <- The material is TRANSPARENT <- The material implements the VOLUME interface |
Definition at line 31 of file Material.hpp.
|
virtualdefault |
|
explicitprotected |
Creates a named material with the given aspect.
| instanceName | |
| materialName | |
| aspect |
Definition at line 6 of file Material.cpp.
|
inline |
Definition at line 45 of file Material.hpp.
|
inline |
Get the aspect (MAT_OPAQUE or MAT_TRANSPARENT) of the material.
Definition at line 61 of file Material.hpp.
|
inline |
Definition at line 50 of file Material.hpp.
|
inlineoverridevirtual |
Get the list of properties the material migh use in a shader.
Each property will be added to the shader used for rendering this material under the form "#define theProperty". Shaders that support the given property could then fully render the material. Others migh render the meterial eroneously.
The default implementation returns an empty list.
: Validate this proposal
: make the property list modifiable as well
Reimplemented from Ra::Engine::Data::ShaderParameterProvider.
Definition at line 78 of file Material.hpp.
|
inlinevirtual |
Indicates if the material takes the VERTEX_COLOR attribute into account.
Reimplemented in Ra::Engine::Data::BlinnPhongMaterial, and Ra::Engine::Data::SimpleMaterial.
Definition at line 94 of file Material.hpp.
|
inlineprotected |
Return dirty state.
Definition at line 118 of file Material.hpp.
|
inlinevirtual |
Reimplemented in Ra::Engine::Data::BlinnPhongMaterial, and Ra::Engine::Data::VolumetricMaterial.
Definition at line 65 of file Material.hpp.
|
inline |
Mark the Material as needing update before the next OpenGL call.
Definition at line 98 of file Material.hpp.
|
inlineprotected |
Set dirty state to false.
Definition at line 124 of file Material.hpp.
|
inlinevirtual |
Makes the Material take its base color from the VERTEX_COLOR attribute of the rendered geometry.
| state | activate (true) or deactivate (false) VERTEX_COLOR attribute usage |
Any material that support per-vertex color parameterization should implement this method accordingly
Reimplemented in Ra::Engine::Data::BlinnPhongMaterial, and Ra::Engine::Data::SimpleMaterial.
Definition at line 90 of file Material.hpp.
|
inlineprotected |
Set dirty state to true.
Definition at line 121 of file Material.hpp.
|
inline |
set the aspect (MAT_OPAQUE or MAT_TRANSPARENT) of the material.
| aspect |
Definition at line 55 of file Material.hpp.
|
inlineprotected |
Change the material name.
Definition at line 115 of file Material.hpp.
Here is the call graph for this function: