1#include <Engine/Data/PlainMaterial.hpp>
3#include <Engine/Data/ShaderConfigFactory.hpp>
4#include <Engine/Data/ShaderProgramManager.hpp>
5#include <Engine/Data/TextureManager.hpp>
6#include <Engine/RadiumEngine.hpp>
7#include <Engine/Rendering/RenderTechnique.hpp>
17nlohmann::json PlainMaterial::s_parametersMetadata = {};
24 auto resourcesRootDir { RadiumEngine::getInstance()->getResourcesDir() };
25 auto shaderProgramManager = RadiumEngine::getInstance()->getShaderProgramManager();
27 shaderProgramManager->addNamedString(
"/Plain.glsl",
28 resourcesRootDir +
"Shaders/Materials/Plain/Plain.glsl" );
32 resourcesRootDir +
"Shaders/Materials/Plain/Plain.vert.glsl",
33 resourcesRootDir +
"Shaders/Materials/Plain/Plain.frag.glsl" );
39 resourcesRootDir +
"Shaders/Materials/Plain/Plain.vert.glsl",
40 resourcesRootDir +
"Shaders/Materials/Plain/PlainZPrepass.frag.glsl" );
44 Rendering::EngineRenderTechniques::registerDefaultTechnique(
59 Rendering::EngineRenderTechniques::removeDefaultTechnique(
"Plain" );
63 auto& renderParameters = getParameters();
69 return s_parametersMetadata;
Base class for materials.
MaterialAspect
Identifies the type of the material.
nlohmann::json getParametersMetadata() const override
Get a json containing metadata about the parameters.
PlainMaterial(const std::string &instanceName)
static void unregisterMaterial()
void updateFromParameters() override
Update the attributes of the ShaderParameterProvider to their actual values stored in the renderParam...
static void registerMaterial()
Base implementation for simple, monocolored, materials.
static void loadMetaData(nlohmann::json &destination)
Load the material parameter description.
void setColoredByVertexAttrib(bool state) override
Makes the Material take its base color from the VERTEX_COLOR attribute of the rendered geometry.
void setConfiguration(const Data::ShaderConfiguration &newConfig, Core::Utils::Index pass=DefaultRenderingPasses::LIGHTING_OPAQUE)
void addConfiguration(const ShaderConfiguration &config)
Core::Utils::optional< ShaderConfiguration > getConfiguration(const std::string &name)
hepler function to manage enum as underlying types in VariableSet