|
lmgl 1.0.0
A lightweight OpenGL graphics engine library written in C++
|
Represents a material with various properties and textures for 3D rendering. More...
#include <material.hpp>
Public Member Functions | |
| Material (const std::string &name="Default Material") | |
| Constructs a Material with an optional name. | |
| const std::string & | get_name () const |
| Gets the name of the material. | |
| void | set_name (const std::string &name) |
| Sets the name of the material. | |
| const glm::vec3 & | get_albedo () const |
| Gets the albedo color of the material. | |
| void | set_albedo (const glm::vec3 &albedo) |
| Sets the albedo color of the material. | |
| float | get_metallic () const |
| Gets the metallic property of the material. | |
| void | set_metallic (float metallic) |
| Sets the metallic property of the material. | |
| float | get_roughness () const |
| Gets the roughness property of the material. | |
| void | set_roughness (float roughness) |
| Sets the roughness property of the material. | |
| float | get_ao () const |
| Gets the ambient occlusion (AO) property of the material. | |
| void | set_ao (float ao) |
| Sets the ambient occlusion (AO) property of the material. | |
| const glm::vec3 & | get_emissive () const |
| Gets the emissive color of the material. | |
| void | set_emissive (const glm::vec3 &emissive) |
| Sets the emissive color of the material. | |
| void | set_albedo_map (const std::shared_ptr< renderer::Texture > &texture) |
| Sets the albedo texture map of the material. | |
| void | set_normal_map (const std::shared_ptr< renderer::Texture > &texture) |
| Sets the normal texture map of the material. | |
| void | set_metallic_map (const std::shared_ptr< renderer::Texture > &texture) |
| Sets the metallic texture map of the material. | |
| void | set_roughness_map (const std::shared_ptr< renderer::Texture > &texture) |
| Sets the roughness texture map of the material. | |
| void | set_ao_map (const std::shared_ptr< renderer::Texture > &texture) |
| Sets the ambient occlusion (AO) texture map of the material. | |
| void | set_emissive_map (const std::shared_ptr< renderer::Texture > &texture) |
| Sets the emissive texture map of the material. | |
| std::shared_ptr< renderer::Texture > | get_albedo_map () const |
| Gets the albedo texture map of the material. | |
| std::shared_ptr< renderer::Texture > | get_normal_map () const |
| Gets the normal texture map of the material. | |
| std::shared_ptr< renderer::Texture > | get_metallic_map () const |
| Gets the metallic texture map of the material. | |
| std::shared_ptr< renderer::Texture > | get_roughness_map () const |
| Gets the roughness texture map of the material. | |
| std::shared_ptr< renderer::Texture > | get_ao_map () const |
| Gets the ambient occlusion (AO) texture map of the material. | |
| std::shared_ptr< renderer::Texture > | get_emissive_map () const |
| Gets the emissive texture map of the material. | |
| void | bind (const std::shared_ptr< renderer::Shader > &shader) const |
| Binds the material properties and textures to the given shader. | |
Represents a material with various properties and textures for 3D rendering.
The Material class encapsulates properties such as albedo, metallic, roughness, ambient occlusion, and emissive characteristics, along with their corresponding texture maps. It provides methods to set and retrieve these properties and bind them to a shader for rendering.
| lmgl::scene::Material::Material | ( | const std::string & | name = "Default Material" | ) |
| void lmgl::scene::Material::bind | ( | const std::shared_ptr< renderer::Shader > & | shader | ) | const |
Binds the material properties and textures to the given shader.
This method sets the material properties and binds the associated texture maps to the provided shader for rendering.
| shader | A shared pointer to the shader to bind the material to. |
|
inline |
Gets the albedo color of the material.
|
inline |
Gets the albedo texture map of the material.
|
inline |
Gets the ambient occlusion (AO) property of the material.
|
inline |
Gets the ambient occlusion (AO) texture map of the material.
|
inline |
Gets the emissive color of the material.
|
inline |
Gets the emissive texture map of the material.
|
inline |
Gets the metallic property of the material.
|
inline |
Gets the metallic texture map of the material.
|
inline |
Gets the name of the material.
|
inline |
Gets the normal texture map of the material.
|
inline |
Gets the roughness property of the material.
|
inline |
Gets the roughness texture map of the material.
|
inline |
Sets the albedo color of the material.
| albedo | The new albedo color as a glm::vec3. |
| void lmgl::scene::Material::set_albedo_map | ( | const std::shared_ptr< renderer::Texture > & | texture | ) |
Sets the albedo texture map of the material.
| texture | A shared pointer to the albedo texture. |
|
inline |
Sets the ambient occlusion (AO) property of the material.
| ao | The new AO value as a float. |
| void lmgl::scene::Material::set_ao_map | ( | const std::shared_ptr< renderer::Texture > & | texture | ) |
Sets the ambient occlusion (AO) texture map of the material.
| texture | A shared pointer to the AO texture. |
|
inline |
Sets the emissive color of the material.
| emissive | The new emissive color as a glm::vec3. |
| void lmgl::scene::Material::set_emissive_map | ( | const std::shared_ptr< renderer::Texture > & | texture | ) |
Sets the emissive texture map of the material.
| texture | A shared pointer to the emissive texture. |
|
inline |
Sets the metallic property of the material.
| metallic | The new metallic value as a float. |
| void lmgl::scene::Material::set_metallic_map | ( | const std::shared_ptr< renderer::Texture > & | texture | ) |
Sets the metallic texture map of the material.
| texture | A shared pointer to the metallic texture. |
|
inline |
Sets the name of the material.
| name | The new name for the material. |
| void lmgl::scene::Material::set_normal_map | ( | const std::shared_ptr< renderer::Texture > & | texture | ) |
Sets the normal texture map of the material.
| texture | A shared pointer to the normal texture. |
|
inline |
Sets the roughness property of the material.
| roughness | The new roughness value as a float. |
| void lmgl::scene::Material::set_roughness_map | ( | const std::shared_ptr< renderer::Texture > & | texture | ) |
Sets the roughness texture map of the material.
| texture | A shared pointer to the roughness texture. |