1#include <Engine/Data/LambertianMaterial.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>
14static const std::string materialName {
"Lambertian" };
16nlohmann::json LambertianMaterial::s_parametersMetadata = {};
23 auto resourcesRootDir { RadiumEngine::getInstance()->getResourcesDir() };
24 auto shaderProgramManager = RadiumEngine::getInstance()->getShaderProgramManager();
26 shaderProgramManager->addNamedString(
27 "/Lambertian.glsl", resourcesRootDir +
"Shaders/Materials/Lambertian/Lambertian.glsl" );
31 resourcesRootDir +
"Shaders/Materials/Lambertian/Lambertian.vert.glsl",
32 resourcesRootDir +
"Shaders/Materials/Lambertian/Lambertian.frag.glsl" );
38 resourcesRootDir +
"Shaders/Materials/Lambertian/Lambertian.vert.glsl",
39 resourcesRootDir +
"Shaders/Materials/Lambertian/LambertianZPrepass.frag.glsl" );
43 Rendering::EngineRenderTechniques::registerDefaultTechnique(
59 Rendering::EngineRenderTechniques::removeDefaultTechnique( materialName );
63 auto& renderParameters = getParameters();
69 return s_parametersMetadata;
LambertianMaterial(const std::string &instanceName)
Construct a named Lambertian material.
void updateFromParameters() override
Update the attributes of the ShaderParameterProvider to their actual values stored in the renderParam...
static void unregisterMaterial()
Remove the material from the material library.
nlohmann::json getParametersMetadata() const override
Get a json containing metadata about the parameters.
static void registerMaterial()
Register the material in the material library.
Base class for materials.
MaterialAspect
Identifies the type of the material.
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