Radium Engine
1.5.20
|
Base implementation for simple, monocolored, materials. More...
#include <Engine/Data/SimpleMaterial.hpp>
Public Types | |
using | TextureSemantic = TextureSemantics::SimpleMaterial |
Public Types inherited from Ra::Engine::Data::Material | |
enum class | MaterialAspect { MAT_OPAQUE , MAT_TRANSPARENT , MAT_DENSITY } |
Identifies the type of the material. More... | |
Public Member Functions | |
SimpleMaterial (const std::string &instanceName, const std::string &materialName, MaterialAspect aspect=MaterialAspect::MAT_OPAQUE) | |
Construct a named material. | |
void | updateGL () override final |
Update the openGL state of the material. | |
void | setColoredByVertexAttrib (bool state) override |
Makes the Material take its base color from the VERTEX_COLOR attribute of the rendered geometry. | |
bool | isColoredByVertexAttrib () const override |
Indicates if the material takes the VERTEX_COLOR attribute into account. | |
void | setColor (Core::Utils::Color c) |
Public Member Functions inherited from Ra::Engine::Data::Material | |
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. | |
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 | updateFromParameters () |
Update the attributes of the ShaderParameterProvider to their actual values stored in the renderParameters. | |
Public Member Functions inherited from Ra::Engine::Data::ParameterSetEditingInterface | |
virtual nlohmann::json | getParametersMetadata () const =0 |
Get a json containing metadata about the parameters. | |
Public Member Functions inherited from Ra::Engine::Data::MaterialTextureSet< TextureSemantics::SimpleMaterial > | |
void | addTexture (const TextureSemantics::SimpleMaterial &semantic, const TextureManager::TextureHandle &texture) |
void | addTexture (const TextureSemantics::SimpleMaterial &semantic, const TextureParameters &texture) |
Add texture to TextureManager fisrt, then to the texture set. | |
Texture * | getTexture (const TextureSemantics::SimpleMaterial &semantic) const |
Texture getter from semantic. | |
Static Protected Member Functions | |
static void | loadMetaData (nlohmann::json &destination) |
Load the material parameter description. | |
Additional Inherited Members | |
Static Public Member Functions inherited from Ra::Engine::Data::ParameterSetEditingInterface | |
static void | loadMetaData (const std::string &basename, nlohmann::json &destination) |
Load the ParameterSet description. | |
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. | |
Base implementation for simple, monocolored, materials.
This material could not be used as is. Only derived class could be used by a renderer.
Definition at line 29 of file SimpleMaterial.hpp.
Definition at line 34 of file SimpleMaterial.hpp.
|
explicit |
Construct a named material.
name | The name of the material |
Definition at line 10 of file SimpleMaterial.cpp.
|
inlineoverridevirtual |
Indicates if the material takes the VERTEX_COLOR attribute into account.
Reimplemented from Ra::Engine::Data::Material.
Definition at line 50 of file SimpleMaterial.hpp.
|
staticprotected |
Load the material parameter description.
Definition at line 35 of file SimpleMaterial.cpp.
|
inline |
Definition at line 52 of file SimpleMaterial.hpp.
|
inlineoverridevirtual |
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 from Ra::Engine::Data::Material.
Definition at line 71 of file SimpleMaterial.hpp.
|
finaloverridevirtual |
Update the openGL state of the material.
This state only consists on associated textures.
Implements Ra::Engine::Data::ShaderParameterProvider.
Definition at line 28 of file SimpleMaterial.cpp.