1#include <Engine/Data/SimpleMaterial.hpp>
2#include <Engine/Data/TextureManager.hpp>
3#include <Engine/RadiumEngine.hpp>
13 Material( instanceName, materialName, aspect ) {}
15void SimpleMaterial::updateRenderingParameters() {
16 auto& renderParameters = getParameters();
18 renderParameters.setVariable(
"material.color", m_color );
19 renderParameters.setVariable(
"material.perVertexColor", m_perVertexColor );
21 if ( tex !=
nullptr ) { renderParameters.setTexture(
"material.tex.color", tex ); }
22 renderParameters.setVariable(
"material.tex.hasColor", tex !=
nullptr );
23 tex =
getTexture( SimpleMaterial::TextureSemantic::TEX_MASK );
24 if ( tex !=
nullptr ) { renderParameters.setTexture(
"material.tex.mask", tex ); }
25 renderParameters.setVariable(
"material.tex.hasMask", tex !=
nullptr );
31 updateRenderingParameters();
Texture * getTexture(const TextureSemantics::SimpleMaterial &semantic) const
Base class for materials.
bool isDirty()
Return dirty state.
void setClean()
Set dirty state to false.
MaterialAspect
Identifies the type of the material.
static void loadMetaData(const std::string &basename, nlohmann::json &destination)
Load the ParameterSet description.
void updateGL() override final
Update the openGL state of the material.
static void loadMetaData(nlohmann::json &destination)
Load the material parameter description.
SimpleMaterial(const std::string &instanceName, const std::string &materialName, MaterialAspect aspect=MaterialAspect::MAT_OPAQUE)
Construct a named material.
Represent a Texture of the engine.
hepler function to manage enum as underlying types in VariableSet