3 #include <Engine/RaEngine.hpp>
8 #include <Core/Utils/Color.hpp>
9 #include <Engine/Data/Material.hpp>
10 #include <Engine/Data/Texture.hpp>
30 const std::string& materialName,
31 MaterialAspect aspect = MaterialAspect::MAT_OPAQUE );
44 void updateGL() override final;
62 inline
void addTexture( const TextureSemantic& semantic,
Texture* texture );
69 inline
Texture* getTexture( const TextureSemantic& semantic ) const;
71 inline
void setColoredByVertexAttrib(
bool state ) override;
73 inline
bool isColoredByVertexAttrib() const override;
77 Core::Utils::
Color m_color { 0.9, 0.9, 0.9, 1.0 };
80 bool m_perVertexColor {
false };
86 void updateRenderingParameters();
91 std::map<TextureSemantic, Texture*> m_textures;
95 std::map<TextureSemantic, TextureParameters> m_pendingTextures;
99 static void loadMetaData( nlohmann::json& destination );
104 m_textures[semantic] = texture;
107 m_pendingTextures.erase( semantic );
113 m_pendingTextures[semantic] = texture;
116 return m_pendingTextures[semantic];
122 auto it = m_textures.find( semantic );
123 if ( it != m_textures.end() ) { tex = it->second; }
TextureSemantic
Semantic of the texture : define which BSDF parameter is controled by the texture.
bool isColoredByVertexAttrib() const override
Indicates if the material takes the VERTEX_COLOR attribute into account.
void setColoredByVertexAttrib(bool state) override
Makes the Material take its base color from the VERTEX_COLOR attribute of the rendered geometry.
TextureParameters & addTexture(const TextureSemantic &semantic, const TextureParameters &texture)
Texture * getTexture(const TextureSemantic &semantic) const