13#define GLM_FORCE_RADIANS
14#define GLM_FORCE_DEPTH_ZERO_TO_ONE
15#include <glm/vec2.hpp>
16#include <glm/vec3.hpp>
17#include <glm/vec4.hpp>
18#include <glm/mat4x4.hpp>
58 enum class Type { Float, Vec2, Vec3, Vec4 };
82 std::vector<MaterialParameterLayoutEntry>
layout;
86 for (
const auto& entry :
layout)
88 if (entry.name == name &&
92 buffer.data() + entry.offset,
103 for (
const auto& entry :
layout)
105 if (entry.name == name &&
109 buffer.data() + entry.offset,
120 for (
const auto& entry :
layout)
122 if (entry.name == name &&
126 buffer.data() + entry.offset,
137 for (
const auto& entry :
layout)
142 buffer.data() + entry.offset,
2D drawable component for rendering textured quad.
static const std::vector< MaterialParameterLayoutEntry > Font2DLayout
static const std::vector< MaterialParameterLayoutEntry > Rectangle2DLayout
MaterialDomain
Specifies the rendering domain where the material is used.
BlendMode
Specifies how the material handles transparency.
ShadingModel
Specifies the shading model used by the material.
Describes the layout of a single packed parameter inside a uniform buffer.
Settings required to define a material instance.
MaterialDomain materialDomain
ShadingModel shadingModel
std::string parentMaterialName
const std::vector< MaterialParameterLayoutEntry > * parameterLayout
Contains the raw buffer data and layout metadata of packed material parameters.
void SetMaterialVec2(const std::string &name, const glm::vec2 &value)
std::vector< uint8_t > buffer
std::vector< MaterialParameterLayoutEntry > layout
void SetMaterialFloat(const std::string &name, float value)
void SetMaterialVec3(const std::string &name, const glm::vec3 &value)
void SetMaterialVec4(const std::string &name, const glm::vec4 &value)