8#include <unordered_map>
11#define GLM_FORCE_RADIANS
12#define GLM_FORCE_DEPTH_ZERO_TO_ONE
14#include <glm/vec3.hpp>
15#include <glm/vec4.hpp>
21class IMaterialRenderResources;
82 void SetFloat(
const std::string& name,
float value);
90 void SetVec3(
const std::string& name, glm::vec3 value);
98 void SetVec4(
const std::string& name, glm::vec4 value);
105 void AddTexture(
const std::string& textureName);
112 std::unordered_map<std::string, float> mFloatParameters;
113 std::unordered_map<std::string, glm::vec3> mVec3Parameters;
114 std::unordered_map<std::string, glm::vec4> mVec4Parameters;
117 std::vector<std::string> mTextures;
120 std::unique_ptr<IMaterialRenderResources> mGpuHandle;
Interface for backend-specific material GPU resources.
Defines an abstract interface for rendering backends.
void ReleaseRenderResources()
Releases any GPU resources associated with this material.
void InitializeRenderResources()
Initializes backend-specific GPU resources associated with this 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.
std::vector< std::string > GetTextures() const
Returns the list of texture names used by this material.
Material(IRenderer *renderer, MaterialSettings matSettings)
Constructs a new Material instance.
PackedMaterialData PackMaterialParameters()
Packs the current float/vector parameters into a binary buffer and layout metadata.
const MaterialSettings GetMaterialSettings() const
Returns the material's static settings (domain, blend mode, shading model, etc.).
void AddTexture(const std::string &textureName)
Adds a texture name to the material's list of used textures.
void SetFloat(const std::string &name, float value)
Sets a float parameter for the material.
IMaterialRenderResources * GetMaterialRenderResources() const
Returns the backend-specific GPU handle of the material.
Settings required to define a material instance.
Contains the raw buffer data and layout metadata of packed material parameters.