6#include "MaterialTypes.h"
Compatibility aliases for material data names used by older material code.
Engine::Core::MaterialData DiffuseFlatColorMaterialData
Alias for the unified material data type.
Engine::Core::MaterialData L2ShaderMaterialData
Alias for the unified material data type.
Engine::Core::MaterialData StaticLightmapMaterialData
Alias for the unified material data type.
Engine::Core::MaterialData MovableDiffuseShaderMaterialData
Alias for the unified material data type.
Engine::Core::MaterialData DynamicTexturesMaterialData
Alias for the unified material data type.
Engine::Core::MaterialData MaterialData
Alias for the unified material data type.
Engine::Core::MaterialData DiffuseShaderMaterialData
Alias for the unified material data type.
Engine::Core::MaterialData L1ShaderMaterialData
Alias for the unified material data type.
Engine::Core::MaterialData NormalMaterialData
Alias for the unified material data type.
Engine::Core::MaterialData L0ShaderMaterialData
Alias for the unified material data type.
PipelineNames
Named graphics pipelines used by material selection and shader lookup.
@ NORMALS_SHADER
Debug pipeline that renders mesh normals.
CPU-side material description consumed by renderer material upload code.
uint32_t lightmapTextureIndex
Lightmap texture descriptor index, or 0xFFFFFFFF when absent.
MaterialData & withBaseColorTexture(uint32_t idx)
Sets the base-color texture descriptor index.
MaterialData()=default
Creates a material with default values and the normals debug pipeline.
float alphaCutoff
Alpha-mask discard threshold. Values below 1.0f mark the material as masked.
MaterialData & withDebugMode(uint32_t d)
Sets the material debug mode selector.
float metallicFactor
Scalar metallic value used when no metallic-roughness texture is present.
uint32_t debugMode
Material debug mode selector.
bool isAlphaMasked() const
Checks whether the material is configured for alpha masking.
MaterialData & withBaseColorFactor(const glm::vec4 &fac)
Sets the linear RGBA base-color multiplier.
MaterialData & withAmbientTerm(float a)
Sets the ambient lighting term.
float normalScale
Scale applied to sampled tangent-space normals.
bool hasNormalTexture() const
Checks whether a normal texture descriptor index is present.
Rendering::PipelineNames pipeline
Graphics pipeline used to interpret this material.
bool hasLightmapTexture() const
Checks whether a lightmap texture descriptor index is present.
uint32_t baseColorTextureIndex
Base-color texture descriptor index, or 0xFFFFFFFF when absent.
MaterialData & withEmissiveFactor(const glm::vec3 &fac)
Sets the linear RGB emissive multiplier.
uint32_t emissiveTextureIndex
Emissive texture descriptor index, or 0xFFFFFFFF when absent.
bool hasBaseColorTexture() const
Checks whether a base-color texture descriptor index is present.
float ambientTerm
Ambient lighting term mixed with probe or spherical harmonics lighting.
uint32_t toneMapping
Material tone-mapping mode: 0=None, 1=Reinhard, 2=ACES.
bool normalMapBC5
True when the normal map stores X and Y in BC5/RG format and reconstructs Z.
glm::vec4 baseColorFactor
Linear RGBA base-color multiplier.
MaterialData & withMetallicRoughnessTexture(uint32_t idx)
Sets the metallic-roughness texture descriptor index.
float roughnessFactor
Scalar roughness used when no metallic-roughness texture is present.
MaterialData & withNormalScale(float s)
Sets the normal map scale.
MaterialData & withEmissiveTexture(uint32_t idx)
Sets the emissive texture descriptor index.
MaterialData & withNormalTexture(uint32_t idx)
Sets the normal texture descriptor index.
MaterialData & withLightmapTexture(uint32_t idx)
Sets the lightmap texture descriptor index.
bool hasEmissiveTexture() const
Checks whether an emissive texture descriptor index is present.
MaterialData & withToneMapping(uint32_t t)
Sets the material tone-mapping mode.
MaterialData & withRoughness(float r)
Sets the scalar roughness value.
bool hasMetallicRoughnessTexture() const
Checks whether a metallic-roughness texture descriptor index is present.
uint32_t normalTextureIndex
Normal texture descriptor index, or 0xFFFFFFFF when absent.
MaterialData & withShScale(float s)
Sets the spherical harmonics lighting multiplier.
MaterialData & withAlphaCutoff(float cutoff)
Sets the alpha-mask cutoff threshold.
MaterialData(Rendering::PipelineNames pipe)
Creates a material for a specific pipeline.
MaterialData & withMetallic(float m)
Sets the scalar metallic value.
float shScale
Spherical harmonics lighting multiplier.
MaterialData(Rendering::PipelineNames pipe, uint32_t baseColorTexIdx, const glm::vec4 &baseColorFac)
Creates a material with a pipeline, base-color texture, and base-color factor.
uint32_t roughnessMetallicTextureIndex
Metallic-roughness texture descriptor index, or 0xFFFFFFFF when absent.
MaterialData & withNormalMapBC5(bool bc5)
Selects BC5/RG normal map decoding.