17class MaterialRegistry;
29 using type = uint64_t;
31 static constexpr auto UniShadow = type{1 << 0};
32 static constexpr auto PointShadow = type{1 << 1};
33 static constexpr auto Depth = type{1 << 2};
34 static constexpr auto Toon = type{1 << 3};
35 static constexpr auto Normals = type{1 << 4};
42constexpr auto ShadowedToonMaterial = MaterialPassFlag::UniShadow | MaterialPassFlag::PointShadow | MaterialPassFlag::Depth | MaterialPassFlag::Toon | MaterialPassFlag::Normals;
52 float normalIntensity = 1.0f;
53 float hatchTiling = 1.0f;
54 float gradientAmount = 0.1f;
55 float reflectivity = 0.0f;
56 uint32_t useTextureNormals = 1;
57 uint32_t useFlatShading = 1;
63 std::string name =
"DefaultMaterial";
84 auto GetName() const -> std::string_view;
85 void SetName(std::string_view name);
106 void Release() noexcept;
110 : m_handle{std::exchange(other.m_handle, NullMaterialInstanceHandle)}
114inline MaterialInstance& MaterialInstance::operator=(MaterialInstance&& other)
noexcept
119 m_handle = std::exchange(other.m_handle, NullMaterialInstanceHandle);
125inline MaterialInstance::~MaterialInstance() noexcept
MaterialPassFlag::type MaterialPassFlags
Set of flags indicating a MaterialInstance's enabled passes.
Definition: Material.h:39
constexpr auto NullMaterialInstanceHandle
Null identifier for a MaterialInstance.
Definition: Material.h:24
uint32_t MaterialInstanceHandle
Identifier for a MaterialInstance.
Definition: Material.h:21
constexpr auto ShadowedToonMaterial
Default passes for a toon material.
Definition: Material.h:42
Owning wrapper around a material in GPU memory.
Definition: Material.h:70
auto GetHandle() const -> MaterialInstanceHandle
Get the instance's handle.
Definition: Material.h:95
auto GetProperties() const -> const MaterialProperties &
Get the instance's handle.
void SetProperties(const MaterialProperties &properties)
Get the instance's handle.
auto Clone() const -> MaterialInstance
Create a new MaterialInstance from this instance's properties.
friend class graphics::MaterialRegistry
Get the instance's handle.
Definition: Material.h:101
Properties for constructing a MaterialInstance.
Definition: Material.h:62
Material pass flags.
Definition: Material.h:28
Properties of a MaterialInstance passed to shaders.
Definition: Material.h:46
A three component vector.
Definition: Vector.h:29
Definition: AssetViews.h:66