1#include <Engine/Data/RawShaderMaterial.hpp>
3#include <Engine/Data/MaterialConverters.hpp>
4#include <Engine/Data/ShaderConfigFactory.hpp>
5#include <Engine/Rendering/RenderTechnique.hpp>
16 m_shaders { shaders },
17 m_paramProvider {
std::move( paramProvider ) } {
18 m_materialKey = computeKey();
23RawShaderMaterial::~RawShaderMaterial() {
24 Rendering::EngineRenderTechniques::removeDefaultTechnique( m_materialKey );
30 for (
const auto& p : m_shaders ) {
42 for (
const auto& p : m_shaders ) {
43 myConfig.addShaderSource( p.first, p.second );
49 auto materialKey { m_materialKey };
51 Rendering::EngineRenderTechniques::registerDefaultTechnique(
74 m_paramProvider->updateGL();
81 Rendering::EngineRenderTechniques::removeDefaultTechnique( m_materialKey );
83 if ( paramProvider ) { m_paramProvider =
std::move( paramProvider ); }
84 m_materialKey = computeKey();
Base class for materials.
void setMaterialName(std::string newName)
Change the material name.
MaterialAspect
Identifies the type of the material.
void updateGL() override final
static void unregisterMaterial()
void registerDefaultTechnique()
void updateShaders(const std::vector< std::pair< Data::ShaderType, std::string > > &shaders, std::shared_ptr< Data::ShaderParameterProvider > paramProvider=nullptr)
RawShaderMaterial(const std::string &instanceName, const std::vector< std::pair< Data::ShaderType, std::string > > &shaders, std::shared_ptr< Data::ShaderParameterProvider > paramProvider)
static void registerMaterial()
void setConfiguration(const Data::ShaderConfiguration &newConfig, Core::Utils::Index pass=DefaultRenderingPasses::LIGHTING_OPAQUE)
bool removeMaterialConverter(const std::string &name)
bool registerMaterialConverter(const std::string &name, ConverterFunction converter)
void addConfiguration(const ShaderConfiguration &config)
Core::Utils::optional< ShaderConfiguration > getConfiguration(const std::string &name)
bool removeConfiguration(const std::string &configName)
hepler function to manage enum as underlying types in VariableSet