46 Material(
const std::string &name =
"Default Material");
53 inline const std::string &
get_name()
const {
return m_name; }
60 inline void set_name(
const std::string &name) { m_name = name; }
67 inline const glm::vec3 &
get_albedo()
const {
return m_albedo; }
74 inline void set_albedo(
const glm::vec3 &albedo) { m_albedo = albedo; }
88 inline void set_metallic(
float metallic) { m_metallic = metallic; }
109 inline float get_ao()
const {
return m_ao; }
116 inline void set_ao(
float ao) { m_ao = ao; }
130 inline void set_emissive(
const glm::vec3 &emissive) { m_emissive = emissive; }
137 void set_albedo_map(
const std::shared_ptr<renderer::Texture> &texture);
144 void set_normal_map(
const std::shared_ptr<renderer::Texture> &texture);
165 void set_ao_map(
const std::shared_ptr<renderer::Texture> &texture);
179 inline std::shared_ptr<renderer::Texture>
get_albedo_map()
const {
return m_albedo_map; };
186 inline std::shared_ptr<renderer::Texture>
get_normal_map()
const {
return m_normal_map; };
193 inline std::shared_ptr<renderer::Texture>
get_metallic_map()
const {
return m_metallic_map; };
200 inline std::shared_ptr<renderer::Texture>
get_roughness_map()
const {
return m_roughness_map; };
207 inline std::shared_ptr<renderer::Texture>
get_ao_map()
const {
return m_ao_map; };
214 inline std::shared_ptr<renderer::Texture>
get_emissive_map()
const {
return m_emissive_map; };
224 void bind(
const std::shared_ptr<renderer::Shader> &shader)
const;
231 glm::vec3 m_albedo{1.0f, 1.0f, 1.0f};
234 float m_metallic{0.0f};
237 float m_roughness{0.5f};
243 glm::vec3 m_emissive{0.0f, 0.0f, 0.0f};
246 std::shared_ptr<renderer::Texture> m_albedo_map;
249 std::shared_ptr<renderer::Texture> m_normal_map;
252 std::shared_ptr<renderer::Texture> m_metallic_map;
255 std::shared_ptr<renderer::Texture> m_roughness_map;
258 std::shared_ptr<renderer::Texture> m_ao_map;
261 std::shared_ptr<renderer::Texture> m_emissive_map;
void set_name(const std::string &name)
Sets the name of the material.
Definition material.hpp:60
float get_ao() const
Gets the ambient occlusion (AO) property of the material.
Definition material.hpp:109
const std::string & get_name() const
Gets the name of the material.
Definition material.hpp:53
std::shared_ptr< renderer::Texture > get_roughness_map() const
Gets the roughness texture map of the material.
Definition material.hpp:200
float get_roughness() const
Gets the roughness property of the material.
Definition material.hpp:95
const glm::vec3 & get_albedo() const
Gets the albedo color of the material.
Definition material.hpp:67
void set_roughness_map(const std::shared_ptr< renderer::Texture > &texture)
Sets the roughness texture map of the material.
Definition material.cpp:15
std::shared_ptr< renderer::Texture > get_albedo_map() const
Gets the albedo texture map of the material.
Definition material.hpp:179
void set_metallic(float metallic)
Sets the metallic property of the material.
Definition material.hpp:88
std::shared_ptr< renderer::Texture > get_metallic_map() const
Gets the metallic texture map of the material.
Definition material.hpp:193
std::shared_ptr< renderer::Texture > get_normal_map() const
Gets the normal texture map of the material.
Definition material.hpp:186
float get_metallic() const
Gets the metallic property of the material.
Definition material.hpp:81
void set_emissive_map(const std::shared_ptr< renderer::Texture > &texture)
Sets the emissive texture map of the material.
Definition material.cpp:19
void set_normal_map(const std::shared_ptr< renderer::Texture > &texture)
Sets the normal texture map of the material.
Definition material.cpp:11
const glm::vec3 & get_emissive() const
Gets the emissive color of the material.
Definition material.hpp:123
void set_ao_map(const std::shared_ptr< renderer::Texture > &texture)
Sets the ambient occlusion (AO) texture map of the material.
Definition material.cpp:17
Material(const std::string &name="Default Material")
Constructs a Material with an optional name.
Definition material.cpp:7
void bind(const std::shared_ptr< renderer::Shader > &shader) const
Binds the material properties and textures to the given shader.
Definition material.cpp:21
void set_ao(float ao)
Sets the ambient occlusion (AO) property of the material.
Definition material.hpp:116
void set_albedo_map(const std::shared_ptr< renderer::Texture > &texture)
Sets the albedo texture map of the material.
Definition material.cpp:9
std::shared_ptr< renderer::Texture > get_emissive_map() const
Gets the emissive texture map of the material.
Definition material.hpp:214
void set_roughness(float roughness)
Sets the roughness property of the material.
Definition material.hpp:102
std::shared_ptr< renderer::Texture > get_ao_map() const
Gets the ambient occlusion (AO) texture map of the material.
Definition material.hpp:207
void set_emissive(const glm::vec3 &emissive)
Sets the emissive color of the material.
Definition material.hpp:130
void set_metallic_map(const std::shared_ptr< renderer::Texture > &texture)
Sets the metallic texture map of the material.
Definition material.cpp:13
void set_albedo(const glm::vec3 &albedo)
Sets the albedo color of the material.
Definition material.hpp:74
Namespace for scene-related classes and functions.
Definition camera.cpp:7
Forward declarations for Assimp Material structure.
Definition model_loader.cpp:12
Declaration of the Shader class for managing shader programs in OpenGL.
Texture class for managing OpenGL textures.