Radium Engine
1.5.0
|
#include <Engine/Data/Material.hpp>
Public Types | |
enum class | MaterialAspect { MAT_OPAQUE , MAT_TRANSPARENT , MAT_DENSITY } |
Public Member Functions | |
const std::string & | getInstanceName () const |
const std::string & | getMaterialName () const |
void | setMaterialAspect (const MaterialAspect &aspect) |
const MaterialAspect & | getMaterialAspect () 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 RenderParameters & | getParameters () |
virtual const RenderParameters & | getParameters () const |
virtual void | updateGL ()=0 |
Update the OpenGL states used by the ShaderParameterProvider. These state could be the ones from an associated material (textures, precomputed tables or whatever data associated to the material) or some parameters that are specific to the provider semantic. | |
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) | |
void | setMaterialName (std::string newName) |
Protected Attributes | |
std::string | m_instanceName {} |
Material instance name. | |
MaterialAspect | m_aspect { MaterialAspect::MAT_OPAQUE } |
Material aspect. | |
bool | m_isDirty { true } |
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.
|
explicitprotected |
Creates a named material with the given aspect
instanceName | |
materialName | |
aspect |
Definition at line 6 of file Material.cpp.
|
inline |
Definition at line 62 of file Material.hpp.
|
inline |
Get the aspect (MAT_OPAQUE or MAT_TRANSPARENT) of the material.
Definition at line 79 of file Material.hpp.
|
inline |
Definition at line 68 of file Material.hpp.
|
overridevirtual |
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 18 of file Material.cpp.
|
virtual |
Test if material is transperent.
Reimplemented in Ra::Engine::Data::VolumetricMaterial, and Ra::Engine::Data::BlinnPhongMaterial.
Definition at line 14 of file Material.cpp.
|
inline |
Mark the Material as needing update before the next OpenGL call
Definition at line 116 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::SimpleMaterial, and Ra::Engine::Data::BlinnPhongMaterial.
Definition at line 106 of file Material.hpp.
|
inline |
set the aspect (MAT_OPAQUE or MAT_TRANSPARENT) of the material.
aspect |
Definition at line 73 of file Material.hpp.
|
inlineprotected |
Change the Material Name
Definition at line 54 of file Material.hpp.
|
protected |
Dirty mark : true if the openGL state of the material need to be updated before next draw call
Definition at line 125 of file Material.hpp.