![]() |
Rendering Engine 0.2.9
Modular Graphics Rendering Engine | v0.2.9
|
Represents a material instance with parameter values, texture bindings, and rendering configuration. More...
#include <material.hpp>
Public Member Functions | |
| Material (IRenderer *renderer, MaterialSettings matSettings) | |
| Constructs a new Material instance. More... | |
| ~Material () | |
| const MaterialSettings | GetMaterialSettings () const |
| Returns the material's static settings (domain, blend mode, shading model, etc.). More... | |
| void | InitializeRenderResources () |
| Initializes backend-specific GPU resources associated with this material. More... | |
| void | ReleaseRenderResources () |
| Releases any GPU resources associated with this material. More... | |
| PackedMaterialData | PackMaterialParameters () |
| Packs the current float/vector parameters into a binary buffer and layout metadata. More... | |
| std::vector< std::string > | GetTextures () const |
| Returns the list of texture names used by this material. More... | |
| IMaterialRenderResources * | GetMaterialRenderResources () const |
| Returns the backend-specific GPU handle of the material. More... | |
| void | SetFloat (const std::string &name, float value) |
| Sets a float parameter for the material. More... | |
| void | SetVec2 (const std::string &name, glm::vec2 value) |
| Sets a vec3 parameter for the material. More... | |
| void | SetVec3 (const std::string &name, glm::vec3 value) |
| Sets a vec3 parameter for the material. More... | |
| void | SetVec4 (const std::string &name, glm::vec4 value) |
| Sets a vec4 parameter for the material. More... | |
| void | AddTexture (const std::string &textureName) |
| Adds a texture name to the material's list of used textures. More... | |
Represents a material instance with parameter values, texture bindings, and rendering configuration.
This class encapsulates both the CPU-side representation of a material (its parameters and textures), and a pointer to its backend-specific GPU resource handle.
Definition at line 29 of file material.hpp.
|
explicit |
Constructs a new Material instance.
| renderer | Pointer to the rendering engine interface. |
| matSettings | Settings that define the material behavior. |
Definition at line 10 of file material.cpp.
| rendering_engine::Material::~Material | ( | ) |
Definition at line 17 of file material.cpp.
| void rendering_engine::Material::AddTexture | ( | const std::string & | textureName | ) |
Adds a texture name to the material's list of used textures.
| textureName | Name of the texture (e.g., texture ID or resource name). |
Definition at line 112 of file material.cpp.
| IMaterialRenderResources * rendering_engine::Material::GetMaterialRenderResources | ( | ) | const |
Returns the backend-specific GPU handle of the material.
Definition at line 87 of file material.cpp.
| const MaterialSettings rendering_engine::Material::GetMaterialSettings | ( | ) | const |
Returns the material's static settings (domain, blend mode, shading model, etc.).
Definition at line 22 of file material.cpp.
| std::vector< std::string > rendering_engine::Material::GetTextures | ( | ) | const |
Returns the list of texture names used by this material.
Definition at line 82 of file material.cpp.
| void rendering_engine::Material::InitializeRenderResources | ( | ) |
Initializes backend-specific GPU resources associated with this material.
Must be called after construction and before rendering.
Definition at line 26 of file material.cpp.
| PackedMaterialData rendering_engine::Material::PackMaterialParameters | ( | ) |
Packs the current float/vector parameters into a binary buffer and layout metadata.
This buffer can be uploaded to the GPU as a uniform buffer or push constants.
Definition at line 39 of file material.cpp.
| void rendering_engine::Material::ReleaseRenderResources | ( | ) |
Releases any GPU resources associated with this material.
Definition at line 31 of file material.cpp.
| void rendering_engine::Material::SetFloat | ( | const std::string & | name, |
| float | value | ||
| ) |
Sets a float parameter for the material.
| name | Name of the parameter. |
| value | Float value to set. |
Definition at line 92 of file material.cpp.
| void rendering_engine::Material::SetVec2 | ( | const std::string & | name, |
| glm::vec2 | value | ||
| ) |
Sets a vec3 parameter for the material.
| name | Name of the parameter. |
| value | glm::vec3 value to set. |
Definition at line 97 of file material.cpp.
| void rendering_engine::Material::SetVec3 | ( | const std::string & | name, |
| glm::vec3 | value | ||
| ) |
Sets a vec3 parameter for the material.
| name | Name of the parameter. |
| value | glm::vec3 value to set. |
Definition at line 102 of file material.cpp.
| void rendering_engine::Material::SetVec4 | ( | const std::string & | name, |
| glm::vec4 | value | ||
| ) |
Sets a vec4 parameter for the material.
| name | Name of the parameter. |
| value | glm::vec4 value to set. |
Definition at line 107 of file material.cpp.