![]() |
Rendering Engine 0.2.0
Modular Graphics Rendering Engine | v0.2.0
|
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. | |
| const MaterialSettings | GetMaterialSettings () const |
| Returns the material's static settings (domain, blend mode, shading model, etc.). | |
| void | InitializeRenderResources () |
| Initializes backend-specific GPU resources associated with this material. | |
| void | ReleaseRenderResources () |
| Releases any GPU resources associated with this material. | |
| PackedMaterialData | PackMaterialParameters () |
| Packs the current float/vector parameters into a binary buffer and layout metadata. | |
| std::vector< std::string > | GetTextures () const |
| Returns the list of texture names used by this material. | |
| IMaterialRenderResources * | GetMaterialRenderResources () const |
| Returns the backend-specific GPU handle of the material. | |
| void | SetFloat (const std::string &name, float value) |
| Sets a float parameter for the material. | |
| void | SetVec3 (const std::string &name, glm::vec3 value) |
| Sets a vec3 parameter for the material. | |
| void | SetVec4 (const std::string &name, glm::vec4 value) |
| Sets a vec4 parameter for the material. | |
| void | AddTexture (const std::string &textureName) |
| Adds a texture name to the material's list of used textures. | |
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.
| 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 96 of file material.cpp.
| IMaterialRenderResources * rendering_engine::Material::GetMaterialRenderResources | ( | ) | const |
Returns the backend-specific GPU handle of the material.
Definition at line 76 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 16 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 71 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 20 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 31 of file material.cpp.
| void rendering_engine::Material::ReleaseRenderResources | ( | ) |
Releases any GPU resources associated with this material.
Definition at line 25 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 81 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 86 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 91 of file material.cpp.