Material
An instance can inherit from a parent material and override only specific properties.
- Module
- Renderer
- Header
#include "Renderer/Material.h"- Namespace
Mowo
Ownership: a Material is RefCounted and lives behind Ref<Material>. Assets (ModelResource, MaterialAsset) hold the Ref; a component's raw Material* is a VIEW derived from a Ref somebody else holds, never an owner. The last Ref to drop frees the material and, through it, its GPU texture refs — exactly once, however many components shared it. Creation goes through Create()/CreatePBR()/Clone(): every allocation AND the deleting destructor below run inside the Renderer image, so a Ref released from any other DLL frees through the same heap that allocated.
Properties
| Type | Name | Description |
|---|---|---|
static constexpr float | kWorldGridAlbedoLane | The GBuffer push block's bindless-albedo lane names a table slot when it is >= 0 and the per-material set at -1; this value below both selects the grid, so no pipeline or push-constant byte had to be added for it. Default -2.0f. |
Constructors
| Signature | Name | Description |
|---|---|---|
Material() = default | Material | |
~Material() override | ~Material | |
Material(const Material&) = delete | Material | A material is never copied as a value: the count belongs to one object. |
Public functions
| Returns | Name | Description |
|---|---|---|
Material& | operator= | |
Ref<Material> | Create | |
Ref<Material> | Clone | New object, same surface: textures are shared by Ref, the parent pointer is shared, the identity is fresh — the DS cache treats it as a different material, which it is. |
void | CopyFrom | Overwrites the surface with other's. |
void | ResetInPlace | Back to a default-constructed surface IN PLACE — the object, its address and its identity survive, so every Ref and every view keeps working. |
uint64_t | GetStableId | |
uint64_t | GetStateVersion | Moves on every write to the surface (any setter, CopyFrom, ResetInPlace, ResetToParent), including writes inside an FTransparentWriteScope. |
void | SetBaseColor | |
Vec4 | GetBaseColor | |
const Vec4& | GetLocalBaseColor | |
Vec3 | GetAverageTextureColor | Linear-space average of the albedo texture (white when untextured or the average is unknown). |
float | GetAverageTextureAlpha | Linear average of the albedo texture's ALPHA channel (1 when untextured/unknown). |
void | SetMetallic | |
float | GetMetallic | |
float | GetLocalMetallic | |
void | SetRoughness | |
float | GetRoughness | |
float | GetLocalRoughness | |
void | SetAO | |
float | GetAO | |
float | GetLocalAO | |
void | SetOpacity | |
float | GetOpacity | |
bool | IsTransparent | Translucent when the surface lets anything through OR when its blend mode is not plain alpha: a FULLY opaque additive material (glow cards, holograms) still has to leave the GBuffer and draw in the blended pass, and inferring translucency from opacity alone silently made those opaque. |
void | SetAlphaBlended | Blended by the source's alpha (glTF alphaMode BLEND): the coverage lives in the base-colour texture's alpha, so opacity alone reads 1 and would leave the surface in the G-Buffer as a solid quad. |
bool | IsAlphaBlended | |
void | SetBlendMode | How a translucent surface combines with what is behind it. |
EMaterialBlendMode | GetBlendMode | |
void | SetAlphaMasked | Alpha-masked (cutout) rendering — foliage/fences: the GBuffer and shadow passes clip pixels whose albedo alpha falls below the cutoff instead of blending. |
bool | IsAlphaMasked | |
void | SetAlphaCutoff | |
float | GetAlphaCutoff | |
void | SetDoubleSided | Double-sided: rendered with backface culling off (leaf cards, cloth). |
bool | IsDoubleSided | |
void | SetEmissiveColor | |
Vec3 | GetEmissiveColor | |
const Vec3& | GetLocalEmissiveColor | |
void | SetEmissiveStrength | |
float | GetEmissiveStrength | |
float | GetLocalEmissiveStrength | |
void | SetSpecularColor | Legacy specular properties (for backward compatibility) |
const Vec3& | GetSpecularColor | |
void | SetShininess | |
float | GetShininess | |
void | SetAlbedoTex | Instance inheritance: a texture setter marks its override flag, and the getter falls back to the parent when this instance hasn't overridden the slot — so an instance with no texture override renders the parent's texture instead of nothing. |
Ref<Texture2D> | GetAlbedoTex | |
void | SetNormalTex | |
Ref<Texture2D> | GetNormalTex | |
void | SetMetallicRoughnessTex | |
Ref<Texture2D> | GetMetallicRoughnessTex | |
void | SetAOTex | |
Ref<Texture2D> | GetAOTex | |
void | SetEmissiveTex | |
Ref<Texture2D> | GetEmissiveTex | |
void | SetOpacityTex | Standalone opacity/cutout mask — the DCC-FBX foliage convention, where coverage lives in its own grayscale map instead of the albedo's alpha. |
Ref<Texture2D> | GetOpacityTex | |
void | SetDetailAlbedoTex | Detail maps — overlaid on primary albedo / normal at close range. |
Ref<Texture2D> | GetDetailAlbedoTex | |
void | SetDetailNormalTex | |
Ref<Texture2D> | GetDetailNormalTex | |
void | SetMaskMapTex | Mask map — single RGBA8 replaces metallic + AO + smoothness + detail mask, packed HDRP-style: R = metallic, G = AO, B = detail mask, A = smoothness (1 - roughness) When set, the shader uses the mask map values instead of the scalar metallic/AO/roughness in BaseColor/PBRParams. |
Ref<Texture2D> | GetMaskMapTex | |
void | SetDetailTiling | |
const Vec2& | GetDetailTiling | |
void | SetDetailAlbedoStrength | |
float | GetDetailAlbedoStrength | |
void | SetDetailNormalStrength | |
float | GetDetailNormalStrength | |
void | SetHeightTex | Parallax Occlusion Mapping. |
Ref<Texture2D> | GetHeightTex | |
void | SetParallaxHeightScale | |
float | GetParallaxHeightScale | |
void | SetDisplacementMagnitude | |
float | GetDisplacementMagnitude | |
void | SetDisplacementCenter | |
float | GetDisplacementCenter | |
void | SetClearCoatIntensity | Clear coat — a second specular lobe on top of the base BRDF, modeling a thin transparent lacquer layer (car paint, painted wood, soda cans). |
float | GetClearCoatIntensity | |
void | SetClearCoatRoughness | |
float | GetClearCoatRoughness | |
void | SetAnisotropy | Anisotropy — stretches the specular highlight along the surface tangent (positive) or bitangent (negative). |
float | GetAnisotropy | |
void | SetSubsurfaceStrength | Subsurface scattering — fakes the warm glow on the shadow-side of skin / wax / foliage by softening the diffuse terminator and tinting with albedo. |
float | GetSubsurfaceStrength | |
void | SetIridescenceIntensity | Iridescence — thin-film interference giving hue shifts based on view angle. |
float | GetIridescenceIntensity | |
void | SetHair | Hair shading model — switches the lighting pass to an anisotropic Kajiya-Kay strand model (dual shifted specular lobes) instead of GGX, for hair/fur cards. |
bool | IsHair | |
void | SetShadingModel | Explicit shading model (G2). |
EShadingModel | GetShadingModel | |
EShadingModel | GetEffectiveShadingModel | |
void | SetTransmissionStrength | TwoSidedFoliage transmission: how much light bleeds through the surface from behind, tinted by albedo. |
float | GetTransmissionStrength | |
void | SetSheenIntensity | Cloth sheen: how much of the Charlie retro-reflective lobe rides on top of the base diffuse. |
float | GetSheenIntensity | |
void | SetEyeParams | Eye's parameters. |
const FEyeSurfaceParams& | GetEyeParams | |
uint32_t | GetTextureVersion | |
bool | HasAnyTexture | Uses the fallback getters so an instance counts textures inherited from its parent (not just its own overrides). |
void | SetTerrainSplat | Terrain splat: the GBuffer draws this material through the TERRAIN_SPLAT pipeline — vertex color = 4 layer weights over the albedo/detailAlbedo/detailNormal/maskMap image slots. |
bool | IsTerrainSplat | |
void | SetFoliageWind | Foliage wind: the GBuffer draws this material through the FOLIAGE pipeline — vertex color alpha = bend weight, DetailParams repurposed as wind direction/strength/speed (foliage has no detail maps). |
bool | IsFoliageWind | |
void | SetWindParams | |
const Vec2& | GetWindDirection | |
float | GetWindStrength | |
float | GetWindSpeed | |
void | SetReflective | Reflective translucent surface: the forward transparent pass casts a single mirror reflection ray through the world SDF clipmap (shaded from the radiance cache, sky on miss) and composites it Fresnel-weighted over the glass. |
bool | IsReflective | |
void | SetWater | Water: the transparent pass draws this material through the WATER pipeline — Gerstner vertex displacement + fresnel shading. |
bool | IsWater | |
void | SetWaterWaveParams | |
void | SetWaterTime | |
float | GetWaterTime | |
const Vec2& | GetWaveDirection | |
float | GetWaveAmplitude | |
float | GetWaveLength | |
float | GetWaveSteepness | |
float | GetWaveSpeed | |
void | SetWorldGrid | World grid: the albedo becomes the procedural grid and the albedo texture is ignored. |
bool | IsWorldGrid | |
void | SetWorldGridParams | |
const FWorldGridParams& | GetWorldGridParams | |
Vec4 | PackWorldGridDetailParams | DetailParams of a grid draw: x = major cell, y = minor cell (metres, clamped away from zero), z/w = major/minor line shades. |
void | SetPhysicsMaterialPath | The physics surface. |
void | SetPhysicsSurfaceName | |
const std::string& | GetLocalPhysicsMaterialPath | |
const std::string& | GetLocalPhysicsSurfaceName | |
const std::string& | GetPhysicsMaterialPath | |
const std::string& | GetPhysicsSurfaceName | |
bool | HasAuthoredPhysics | Whether anyone authored a physics answer at all. |
void | SetName | |
const std::string& | GetName | |
void | SetParent | |
Material* | GetParent | |
bool | IsInstance | |
MaterialOverride | GetOverrideFlags | |
bool | HasOverride | |
void | SetOverride | |
void | ClearAllOverrides | |
void | ResetToParent | |
Ref<Material> | CreateInstance | The instance points at its parent but does not own it: whoever holds the parent's Ref (its asset) must outlive the instance, as before. |
Ref<Material> | CreateDefault | |
Ref<Material> | CreateColored | |
Ref<Material> | CreateMetallic | |
Ref<Material> | CreateMatte | |
Ref<Material> | CreatePBR | |
Ref<Material> | CreatePBRMetal | |
Ref<Material> | CreatePBRDielectric | |
Ref<Material> | CreateWorldGrid | The engine default surface: a mid-grey world grid, rough dielectric. |
void | SetGraphShaderId | Compiled material graph (UE5-gap Q1). |
const std::string& | GetGraphShaderId | |
bool | HasGraphShader | |
uint64_t | GetGraphShaderHash | The id as the number it was printed from, so the renderer's ten graph pipeline caches key on a word instead of rebuilding a 16-character string per draw per pass per cascade — one character past MSVC's small string buffer, so every one of those copies allocated. |
uint64_t | HashGraphShaderId | The canonical id is "%016llx" of the graph's content hash, so parsing it recovers that hash exactly and adds no collision the hash did not already carry. |
void | SetGraphHasWpo | G4: whether the graph links a World Position Offset. |
bool | HasGraphWpo | |
void | SetGraphWpoBound | Conservative world-space bound on |WPO| from the graph compile (0 = no WPO; a huge sentinel = unboundable subtree). |
float | GetGraphWpoBound | |
void | SetSubstrateTop | The graph's Substrate slab folded to one packed G-Buffer word, 0 when the material has no slab or when its slab moves per pixel. |
uint32_t | GetSubstrateTop | |
void | SetGraphTextures | |
const std::vector<Ref<Texture2D>>& | GetGraphTextures | |
void | SetGraphArraySlotMask | Bit i = the graph samples slot i as a Texture2DArray (CompiledShader:: arraySlotMask). |
uint32_t | GetGraphArraySlotMask | |
void | SetGraphParamLane | R4: the runtime parameter lanes the graph pipelines push per draw. |
Vec4 | GetGraphParamLane | |
void | SetGraphParamLaneCount | |
uint32_t | GetGraphParamLaneCount | |
const Vec4* | GetGraphParams | |
const std::vector<Vec4>& | GetGraphParamsExt |
Function details
Material
Material() = default~Material
~Material() overrideMaterial
Material(const Material&) = deleteA material is never copied as a value: the count belongs to one object. Clone() is the field-wise duplicate; CopyFrom() writes another material's surface into THIS one without touching its identity or its count.
operator=
Material& operator=(const Material&) = deleteCreate
static Ref<Material> Create()Clone
Ref<Material> Clone() constNew object, same surface: textures are shared by Ref, the parent pointer is shared, the identity is fresh — the DS cache treats it as a different material, which it is.
CopyFrom
void CopyFrom(const Material& other)Overwrites the surface with other's. Keeps this object's identity and its in-flight transparent-write depth, and never lets the texture version step backwards: the DS cache keys on it, and a version that re-reached an old value would hand back the old descriptor set.
ResetInPlace
void ResetInPlace()Back to a default-constructed surface IN PLACE — the object, its address and its identity survive, so every Ref and every view keeps working. This is the reimport contract: an asset reloads its material's contents, it does not replace the material. The texture version moves forward for the same reason CopyFrom's does.
GetStableId
uint64_t GetStableId() constGetStateVersion
uint64_t GetStateVersion() constMoves on every write to the surface (any setter, CopyFrom, ResetInPlace, ResetToParent), including writes inside an FTransparentWriteScope. It says nothing about the parent: a cache that snapshots an instance must also check the parent chain.
SetBaseColor
void SetBaseColor(const Vec4& color)GetBaseColor
Vec4 GetBaseColor() constGetLocalBaseColor
const Vec4& GetLocalBaseColor() constGetAverageTextureColor
Vec3 GetAverageTextureColor() constLinear-space average of the albedo texture (white when untextured or the average is unknown). The GI voxelizer multiplies the flat base color by this — matching the GBuffer's baseColor * texture composition at 1-texel resolution — so GI bounce and SDF/RT reflections carry the texture's actual tint instead of the bare base color.
GetAverageTextureAlpha
float GetAverageTextureAlpha() constLinear average of the albedo texture's ALPHA channel (1 when untextured/unknown). For alpha-masked materials this is the cutout coverage — the GI voxelizer dithers occupancy by it and the RT ray queries use it as the stochastic any-hit accept probability.
SetMetallic
void SetMetallic(float metallic)GetMetallic
float GetMetallic() constGetLocalMetallic
float GetLocalMetallic() constSetRoughness
void SetRoughness(float roughness)GetRoughness
float GetRoughness() constGetLocalRoughness
float GetLocalRoughness() constSetAO
void SetAO(float ao)GetAO
float GetAO() constGetLocalAO
float GetLocalAO() constSetOpacity
void SetOpacity(float opacity)GetOpacity
float GetOpacity() constIsTransparent
bool IsTransparent() constTranslucent when the surface lets anything through OR when its blend mode is not plain alpha: a FULLY opaque additive material (glow cards, holograms) still has to leave the GBuffer and draw in the blended pass, and inferring translucency from opacity alone silently made those opaque.
SetAlphaBlended
void SetAlphaBlended(bool blended)Blended by the source's alpha (glTF alphaMode BLEND): the coverage lives in the base-colour texture's alpha, so opacity alone reads 1 and would leave the surface in the G-Buffer as a solid quad.
IsAlphaBlended
bool IsAlphaBlended() constSetBlendMode
void SetBlendMode(EMaterialBlendMode mode)How a translucent surface combines with what is behind it. Alpha is the historical (and default) behaviour; Additive adds light (fire, glows), Modulate multiplies (stained glass, smoked plastic). The RHI has carried all three since G5 — this is the material-level choice that was missing, so authors could only ever get alpha.
GetBlendMode
EMaterialBlendMode GetBlendMode() constSetAlphaMasked
void SetAlphaMasked(bool masked)Alpha-masked (cutout) rendering — foliage/fences: the GBuffer and shadow passes clip pixels whose albedo alpha falls below the cutoff instead of blending. Independent of IsTransparent (which routes to the blended pass).
IsAlphaMasked
bool IsAlphaMasked() constSetAlphaCutoff
void SetAlphaCutoff(float cutoff)GetAlphaCutoff
float GetAlphaCutoff() constSetDoubleSided
void SetDoubleSided(bool doubleSided)Double-sided: rendered with backface culling off (leaf cards, cloth).
IsDoubleSided
bool IsDoubleSided() constSetEmissiveColor
void SetEmissiveColor(const Vec3& color)GetEmissiveColor
Vec3 GetEmissiveColor() constGetLocalEmissiveColor
const Vec3& GetLocalEmissiveColor() constSetEmissiveStrength
void SetEmissiveStrength(float strength)GetEmissiveStrength
float GetEmissiveStrength() constGetLocalEmissiveStrength
float GetLocalEmissiveStrength() constSetSpecularColor
void SetSpecularColor(const Vec3& color)Legacy specular properties (for backward compatibility)
GetSpecularColor
const Vec3& GetSpecularColor() constSetShininess
void SetShininess(float shininess)GetShininess
float GetShininess() constSetAlbedoTex
void SetAlbedoTex(Ref<Texture2D> tex)Instance inheritance: a texture setter marks its override flag, and the getter falls back to the parent when this instance hasn't overridden the slot — so an instance with no texture override renders the parent's texture instead of nothing. Base materials (no parent) always use local.
GetAlbedoTex
Ref<Texture2D> GetAlbedoTex() constSetNormalTex
void SetNormalTex(Ref<Texture2D> tex)GetNormalTex
Ref<Texture2D> GetNormalTex() constSetMetallicRoughnessTex
void SetMetallicRoughnessTex(Ref<Texture2D> tex)GetMetallicRoughnessTex
Ref<Texture2D> GetMetallicRoughnessTex() constSetAOTex
void SetAOTex(Ref<Texture2D> tex)GetAOTex
Ref<Texture2D> GetAOTex() constSetEmissiveTex
void SetEmissiveTex(Ref<Texture2D> tex)GetEmissiveTex
Ref<Texture2D> GetEmissiveTex() constSetOpacityTex
void SetOpacityTex(Ref<Texture2D> tex)Standalone opacity/cutout mask — the DCC-FBX foliage convention, where coverage lives in its own grayscale map instead of the albedo's alpha. When bound, the masked passes clip against THIS texture's red channel rather than the albedo's alpha (an opaque albedo would clip nothing and leave the card a solid quad). Unbound = clip against albedo alpha.
GetOpacityTex
Ref<Texture2D> GetOpacityTex() constSetDetailAlbedoTex
void SetDetailAlbedoTex(Ref<Texture2D> tex)Detail maps — overlaid on primary albedo / normal at close range. Used to add high-frequency surface detail without 4K source textures. detailTiling multiplies the UVs (typically 4-8x). The overlay strength is gated by the mask map's B channel when a mask map is set, so the detail can be limited to specific regions (e.g. dirt-mask only on the bottom half of a wall).
GetDetailAlbedoTex
Ref<Texture2D> GetDetailAlbedoTex() constSetDetailNormalTex
void SetDetailNormalTex(Ref<Texture2D> tex)GetDetailNormalTex
Ref<Texture2D> GetDetailNormalTex() constSetMaskMapTex
void SetMaskMapTex(Ref<Texture2D> tex)Mask map — single RGBA8 replaces metallic + AO + smoothness + detail mask, packed HDRP-style: R = metallic, G = AO, B = detail mask, A = smoothness (1 - roughness) When set, the shader uses the mask map values instead of the scalar metallic/AO/roughness in BaseColor/PBRParams. Saves descriptor slots and bandwidth vs separate textures.
GetMaskMapTex
Ref<Texture2D> GetMaskMapTex() constSetDetailTiling
void SetDetailTiling(const Vec2& tiling)GetDetailTiling
const Vec2& GetDetailTiling() constSetDetailAlbedoStrength
void SetDetailAlbedoStrength(float v)GetDetailAlbedoStrength
float GetDetailAlbedoStrength() constSetDetailNormalStrength
void SetDetailNormalStrength(float v)GetDetailNormalStrength
float GetDetailNormalStrength() constSetHeightTex
void SetHeightTex(Ref<Texture2D> tex)Parallax Occlusion Mapping. Height map is a single-channel R8 texture where 0 = surface, 1 = deepest point. The shader ray-marches along the tangent-space view direction to find the intersection with the height field and displaces UVs accordingly — adds genuine 3D-looking detail at silhouettes without changing geometry. heightScale ~0.02-0.08 for typical floor/wall textures. Larger values exaggerate but break at grazing view angles ("swimming texels"). The shader uses adaptive step count (8-32) based on view-angle perpendicular- ness to keep grazing angles sharp without wasting samples head-on.
GetHeightTex
Ref<Texture2D> GetHeightTex() constSetParallaxHeightScale
void SetParallaxHeightScale(float v)GetParallaxHeightScale
float GetParallaxHeightScale() constSetDisplacementMagnitude
void SetDisplacementMagnitude(float v)GetDisplacementMagnitude
float GetDisplacementMagnitude() constSetDisplacementCenter
void SetDisplacementCenter(float v)GetDisplacementCenter
float GetDisplacementCenter() constSetClearCoatIntensity
void SetClearCoatIntensity(float v)Clear coat — a second specular lobe on top of the base BRDF, modeling a thin transparent lacquer layer (car paint, painted wood, soda cans). Fixed F0 = 0.04 (IOR 1.5 lacquer), per-material intensity scalar attenuates the lobe. Clear coat roughness is independent of base roughness — a rough base under a glossy coat is the classic look. Intensity 0 disables the lobe entirely; 1 = full strength. Typical values: 0.6-0.9 for shiny car paint, 0.3-0.5 for satin lacquer.
GetClearCoatIntensity
float GetClearCoatIntensity() constSetClearCoatRoughness
void SetClearCoatRoughness(float v)GetClearCoatRoughness
float GetClearCoatRoughness() constSetAnisotropy
void SetAnisotropy(float v)Anisotropy — stretches the specular highlight along the surface tangent (positive) or bitangent (negative). The signature look for brushed metal, hair, vinyl records, satin. Zero = isotropic (standard GGX). The lighting pass derives the tangent direction from screen-space position derivatives — no per-mesh tangent texture support yet, so the anisotropy direction approximately follows the surface's screen-space U/V flow. For authored brush direction, a future iteration would store a tangent map in G-Buffer or sample it here.
GetAnisotropy
float GetAnisotropy() constSetSubsurfaceStrength
void SetSubsurfaceStrength(float v)Subsurface scattering — fakes the warm glow on the shadow-side of skin / wax / foliage by softening the diffuse terminator and tinting with albedo. Strength 0 = standard Lambert; 1 = full wrap with curvature. Not real Jimenez-style blur SSS — this is a Penner-style curvature approximation that costs only a fwidth + a few mul-adds per pixel.
GetSubsurfaceStrength
float GetSubsurfaceStrength() constSetIridescenceIntensity
void SetIridescenceIntensity(float v)Iridescence — thin-film interference giving hue shifts based on view angle. Approximated as an HSV rainbow swept by NdotV, mixed with the standard Fresnel by intensity. 0 = disabled. Used for soap bubbles, oil slicks, peacock feathers, beetle wings.
GetIridescenceIntensity
float GetIridescenceIntensity() constSetHair
void SetHair(bool v)Hair shading model — switches the lighting pass to an anisotropic Kajiya-Kay strand model (dual shifted specular lobes) instead of GGX, for hair/fur cards. Mutually exclusive with iridescence in the GBuffer pack (the hair flag rides the sign of the iridescence lane). Pair with a negative Anisotropy so the highlight stretches across the strand width.
IsHair
bool IsHair() constSetShadingModel
void SetShadingModel(EShadingModel m)Explicit shading model (G2). DefaultLit doubles as "legacy auto": GetEffectiveShadingModel derives Hair/Subsurface from the older per-scalar knobs so every existing asset keeps its look without a resave. IDs are the GBuffer wire format (RT3.A high 3 bits) — 0 MUST stay DefaultLit, because impostors and material-less draws write a zero alpha and must remain plain-lit.
GetShadingModel
EShadingModel GetShadingModel() constGetEffectiveShadingModel
EShadingModel GetEffectiveShadingModel() constSetTransmissionStrength
void SetTransmissionStrength(float v)TwoSidedFoliage transmission: how much light bleeds through the surface from behind, tinted by albedo. Only sampled when the shading model is TwoSidedFoliage (it is that model's custom GBuffer lane).
GetTransmissionStrength
float GetTransmissionStrength() constSetSheenIntensity
void SetSheenIntensity(float v)Cloth sheen: how much of the Charlie retro-reflective lobe rides on top of the base diffuse. It is the Cloth model's custom lane, so it only reaches the GBuffer when the material asks for that shading model.
GetSheenIntensity
float GetSheenIntensity() constSetEyeParams
void SetEyeParams(const FEyeSurfaceParams& p)Eye's parameters. They reach the shader through the frame's surface-parameter record, not through a G-Buffer lane, so they are only read when the effective shading model is Eye.
GetEyeParams
const FEyeSurfaceParams& GetEyeParams() constGetTextureVersion
uint32_t GetTextureVersion() constHasAnyTexture
bool HasAnyTexture() constUses the fallback getters so an instance counts textures inherited from its parent (not just its own overrides).
SetTerrainSplat
void SetTerrainSplat(bool on)Terrain splat: the GBuffer draws this material through the TERRAIN_SPLAT pipeline — vertex color = 4 layer weights over the albedo/detailAlbedo/detailNormal/maskMap image slots.
IsTerrainSplat
bool IsTerrainSplat() constSetFoliageWind
void SetFoliageWind(bool on)Foliage wind: the GBuffer draws this material through the FOLIAGE pipeline — vertex color alpha = bend weight, DetailParams repurposed as wind direction/strength/speed (foliage has no detail maps).
IsFoliageWind
bool IsFoliageWind() constSetWindParams
void SetWindParams(const Vec2& direction, float strength, float speed)GetWindDirection
const Vec2& GetWindDirection() constGetWindStrength
float GetWindStrength() constGetWindSpeed
float GetWindSpeed() constSetReflective
void SetReflective(bool on)Reflective translucent surface: the forward transparent pass casts a single mirror reflection ray through the world SDF clipmap (shaded from the radiance cache, sky on miss) and composites it Fresnel-weighted over the glass. Off by default — a non-reflective transparent keeps the plain ambient+refraction look (bit-identical). High/Epic + the r.Reflections.Translucent cvar gate it globally. Clear-coat transparents draw a coat reflection from the same source regardless of this flag.
IsReflective
bool IsReflective() constSetWater
void SetWater(bool on)Water: the transparent pass draws this material through the WATER pipeline — Gerstner vertex displacement + fresnel shading. The material must also be transparent (opacity < 1) to reach that pass at all.
IsWater
bool IsWater() constSetWaterWaveParams
void SetWaterWaveParams(const Vec2& direction, float amplitude, float wavelength, float steepness, float speed)SetWaterTime
void SetWaterTime(float time)GetWaterTime
float GetWaterTime() constGetWaveDirection
const Vec2& GetWaveDirection() constGetWaveAmplitude
float GetWaveAmplitude() constGetWaveLength
float GetWaveLength() constGetWaveSteepness
float GetWaveSteepness() constGetWaveSpeed
float GetWaveSpeed() constSetWorldGrid
void SetWorldGrid(bool on)World grid: the albedo becomes the procedural grid and the albedo texture is ignored. MaterialOverride has no bit left, so an instance inherits the grid from its parent unless it switches it on itself.
IsWorldGrid
bool IsWorldGrid() constSetWorldGridParams
void SetWorldGridParams(const FWorldGridParams& params)GetWorldGridParams
const FWorldGridParams& GetWorldGridParams() constPackWorldGridDetailParams
static Vec4 PackWorldGridDetailParams(const FWorldGridParams& params)DetailParams of a grid draw: x = major cell, y = minor cell (metres, clamped away from zero), z/w = major/minor line shades.
SetPhysicsMaterialPath
void SetPhysicsMaterialPath(const std::string& path)The physics surface. Empty on an instance means "whatever the parent says": MaterialOverride has no bit left to spend on this, and an instance that wanted to differ physically authors one of these fields.
SetPhysicsSurfaceName
void SetPhysicsSurfaceName(const std::string& name)GetLocalPhysicsMaterialPath
const std::string& GetLocalPhysicsMaterialPath() constGetLocalPhysicsSurfaceName
const std::string& GetLocalPhysicsSurfaceName() constGetPhysicsMaterialPath
const std::string& GetPhysicsMaterialPath() constGetPhysicsSurfaceName
const std::string& GetPhysicsSurfaceName() constHasAuthoredPhysics
bool HasAuthoredPhysics() constWhether anyone authored a physics answer at all. A material that did not has to leave the collider exactly as it was, which is what keeps every scene predating this block behaving identically.
SetName
void SetName(const std::string& name)GetName
const std::string& GetName() constSetParent
void SetParent(Material* parent)GetParent
Material* GetParent() constIsInstance
bool IsInstance() constGetOverrideFlags
MaterialOverride GetOverrideFlags() constHasOverride
bool HasOverride(MaterialOverride flag) constSetOverride
void SetOverride(MaterialOverride flag, bool enabled)ClearAllOverrides
void ClearAllOverrides()ResetToParent
void ResetToParent(MaterialOverride flag)CreateInstance
static Ref<Material> CreateInstance(Material* parent)The instance points at its parent but does not own it: whoever holds the parent's Ref (its asset) must outlive the instance, as before.
CreateDefault
static Ref<Material> CreateDefault()CreateColored
static Ref<Material> CreateColored(const Vec4& color)CreateMetallic
static Ref<Material> CreateMetallic(const Vec4& baseColor, float shininess = 64.0f)CreateMatte
static Ref<Material> CreateMatte(const Vec4& baseColor)CreatePBR
static Ref<Material> CreatePBR(const Vec4& baseColor, float metallic, float roughness, float ao = 1.0f)CreatePBRMetal
static Ref<Material> CreatePBRMetal(const Vec4& baseColor, float roughness = 0.3f)CreatePBRDielectric
static Ref<Material> CreatePBRDielectric(const Vec4& baseColor, float roughness = 0.5f)CreateWorldGrid
static Ref<Material> CreateWorldGrid()The engine default surface: a mid-grey world grid, rough dielectric. Every mesh that has no material of its own draws with this.
SetGraphShaderId
void SetGraphShaderId(std::string hexId)Compiled material graph (UE5-gap Q1). A non-empty id names the per-material GBuffer permutation in the shader archive ("Materials/<hex>"); GraphTextures carries the graph's slot-ordered texture bindings for the material descriptor set. Empty id = the classic uber-shader path, untouched.
GetGraphShaderId
const std::string& GetGraphShaderId() constHasGraphShader
bool HasGraphShader() constGetGraphShaderHash
uint64_t GetGraphShaderHash() constThe id as the number it was printed from, so the renderer's ten graph pipeline caches key on a word instead of rebuilding a 16-character string per draw per pass per cascade — one character past MSVC's small string buffer, so every one of those copies allocated.
HashGraphShaderId
static uint64_t HashGraphShaderId(const std::string& hexId)The canonical id is "%016llx" of the graph's content hash, so parsing it recovers that hash exactly and adds no collision the hash did not already carry. Anything else — a hand-written id in a test — is folded instead, which keeps it distinct without pretending it round-trips.
SetGraphHasWpo
void SetGraphHasWpo(bool v)G4: whether the graph links a World Position Offset. Drives the shadow/velocity pipeline swaps — a no-WPO graph keeps the cheap uber vertex path there (the pixel splice is independent of this flag).
HasGraphWpo
bool HasGraphWpo() constSetGraphWpoBound
void SetGraphWpoBound(float v)Conservative world-space bound on |WPO| from the graph compile (0 = no WPO; a huge sentinel = unboundable subtree). The meshlet path inflates its per-cluster cull spheres by it — or, at the sentinel, stops trusting geometric kills for the draw entirely.
GetGraphWpoBound
float GetGraphWpoBound() constSetSubstrateTop
void SetSubstrateTop(uint32_t packed)The graph's Substrate slab folded to one packed G-Buffer word, 0 when the material has no slab or when its slab moves per pixel. Read by the paths that cache ONE answer per surface and therefore cannot carry a per-pixel coat: the GI surface cache's card capture and the ray-traced hit shading. Everything that shades per pixel reads the slab out of the G-Buffer and must ignore this.
GetSubstrateTop
uint32_t GetSubstrateTop() constSetGraphTextures
void SetGraphTextures(std::vector<Ref<Texture2D>> textures)GetGraphTextures
const std::vector<Ref<Texture2D>>& GetGraphTextures() constSetGraphArraySlotMask
void SetGraphArraySlotMask(uint32_t mask)Bit i = the graph samples slot i as a Texture2DArray (CompiledShader:: arraySlotMask). The material descriptor set binds an array image there only for a draw that runs the graph's own pipeline; every other pipeline declares plain 2D slots and gets a 2D stand-in.
GetGraphArraySlotMask
uint32_t GetGraphArraySlotMask() constSetGraphParamLane
void SetGraphParamLane(uint32_t lane, const Vec4& v)R4: the runtime parameter lanes the graph pipelines push per draw. MaterialAsset seeds the graph's defaults and maps names to lanes; gameplay writes lanes through it (SetScalarParameter/SetVectorParameter). The first four lanes are the legacy block every graph pipeline reads; a graph that needs more sizes the extension once at GPU-create time (SetGraphParamLaneCount, from CompiledShader::paramLanes) and the upload copies GetGraphParamLaneCount() lanes instead of four.
GetGraphParamLane
Vec4 GetGraphParamLane(uint32_t lane) constSetGraphParamLaneCount
void SetGraphParamLaneCount(uint32_t lanes)GetGraphParamLaneCount
uint32_t GetGraphParamLaneCount() constGetGraphParams
const Vec4* GetGraphParams() constGetGraphParamsExt
const std::vector<Vec4>& GetGraphParamsExt() const