36 RawType raw = {ValueType(1), ValueType(0), ValueType(0), ValueType(0)};
67 template<glm::length_t L = D>
requires(
L == 2)
73 template<glm::length_t L = D>
requires(
L == 3)
79 template<glm::length_t L = D>
requires(
L == 4)
114 template<
typename ValueType>
116 return rhs.raw == lhs.raw;
124 template<
typename ValueType>
126 return rhs.raw != lhs.raw;
157 ValueType value = ValueType(0);
181 : texture(texture), swizzle(swizzle) {}
185 : value(value), texture(texture), swizzle(swizzle) {}
202 return lhs.
value == rhs.value && lhs.texture == rhs.texture && lhs.sampler == rhs.sampler && lhs.value == rhs.value;
211 template<
typename ValueType,
typename TextureType>
213 return !(lhs == rhs);
288 return lhs.baseColor == rhs.baseColor && lhs.roughness == rhs.roughness && lhs.metallic == rhs.metallic && lhs.normal == rhs.normal &&
289 lhs.emission == rhs.emission && lhs.displacement == rhs.displacement && lhs.ambientOcclusion == rhs.ambientOcclusion;
301template<
typename ValueType>
struct std::hash<CeresEngine::MaterialPropertySwizzle<ValueType>> {
303 size_t operator()(
const Type& swizzle)
const {
312 size_t operator()(
const Type& property)
const {
314 return CeresEngine::hash(property.value, property.texture, property.sampler, property.swizzle);
#define CE_EXPLICIT(EXPR)
Definition Macros.hpp:413
Represents a reflected C++ type. Can be used to get metadata from a C++ type.
Definition Type.hpp:32
Definition Application.hpp:19
TextureType
Definition Texture.hpp:32
bool operator!=(const ShortAllocator< T, N, A1 > &x, const ShortAllocator< U, M, A2 > &y) noexcept
Definition Allocator.hpp:416
bool operator==(const ShortAllocator< T, N, A1 > &x, const ShortAllocator< U, M, A2 > &y) noexcept
Definition Allocator.hpp:411
@ Linear
Interpolate between multiple image samples.
MaterialNormalMapSpace
Specifies the kind of normal map used by a material.
Definition MaterialModel.hpp:244
@ Object
Specifies that the normal map is in object space.
@ Tangent
Specifies that the normal map is in tangent space.
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
Image sampler descriptor structure.
Definition GPUSampler.hpp:61
GPUSamplerFilter minFilter
Minification filter. By default SamplerFilter::Nearest.
Definition GPUSampler.hpp:79
A material property with an associated value and texture.
Definition MaterialModel.hpp:155
MaterialProperty(ValueType value, TextureType texture, MaterialPropertySwizzle< ValueType > swizzle={})
Creates a new material property from both a raw value and an texture.
Definition MaterialModel.hpp:184
MaterialProperty & operator=(const MaterialProperty &)=default
ValueType value
The value associated with the material property.
Definition MaterialModel.hpp:157
MaterialProperty()=default
Creates a new empty material property.
MaterialProperty(MaterialProperty &&) noexcept=default
MaterialProperty(const MaterialProperty &)=default
TMatrix< 4, 4, ValueType > RawType
The raw type used to perform the swizzle.
Definition MaterialModel.hpp:89
constexpr MaterialPropertySwizzle()=default
Creates a new empty material property swizzle.
constexpr MaterialPropertySwizzle(TVector4< ValueType > r, TVector4< ValueType > g, TVector4< ValueType > b, TVector4< ValueType > a)
Creates a new material property swizzle that maps the channels given in r to the properties red chann...
Definition MaterialModel.hpp:103
constexpr MaterialPropertySwizzle(TVector4< ValueType > x, TVector4< ValueType > y, TVector4< ValueType > z)
Creates a new material property swizzle that maps the channels given in x to the properties X channel...
Definition MaterialModel.hpp:74
constexpr MaterialPropertySwizzle(TVector4< ValueType > x, TVector4< ValueType > y, TVector4< ValueType > z, TVector4< ValueType > w)
Creates a new material property swizzle that maps the channels given in x to the properties X channel...
Definition MaterialModel.hpp:80
TMatrix< D, 4, ValueType > RawType
The raw type used to perform the swizzle.
Definition MaterialModel.hpp:54
constexpr MaterialPropertySwizzle(TVector4< ValueType > x, TVector4< ValueType > y)
Creates a new material property swizzle that maps the channels given in x to the properties X channel...
Definition MaterialModel.hpp:68
constexpr MaterialPropertySwizzle()=default
Creates a new empty material property swizzle.
A structure that describes how channels of the input texture should be mapped in the material.
Definition MaterialModel.hpp:31
RawType raw
The vector that represents the swizzle operation.
Definition MaterialModel.hpp:36
constexpr MaterialPropertySwizzle()=default
Creates a new empty material property swizzle.
TVector4< ValueType > RawType
The raw type used to perform the swizzle.
Definition MaterialModel.hpp:33
A material model that represents a PBR surface.
Definition MaterialModel.hpp:256
Vector3MaterialProperty normal
A material channel that represents the normal map of the material.
Definition MaterialModel.hpp:268
DoubleMaterialProperty ambientOcclusion
The material ambient occlusion property.
Definition MaterialModel.hpp:277
DoubleMaterialProperty metallic
A material channel that represents the metallic map of the material.
Definition MaterialModel.hpp:265
ColorMaterialProperty baseColor
A material channel that represents the base color (or albedo) of the material.
Definition MaterialModel.hpp:259
ColorMaterialProperty emission
The material emission property.
Definition MaterialModel.hpp:271
DoubleMaterialProperty roughness
A material channel that represents the roughness map of the material.
Definition MaterialModel.hpp:262
Vector3MaterialProperty displacement
The material displacement property.
Definition MaterialModel.hpp:274