class

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

TypeNameDescription
static constexpr floatkWorldGridAlbedoLaneThe 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

SignatureNameDescription
Material() = defaultMaterial
~Material() override~Material
Material(const Material&) = deleteMaterialA material is never copied as a value: the count belongs to one object.

Public functions

ReturnsNameDescription
Material&operator=
Ref<Material>Create
Ref<Material>CloneNew 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.
voidCopyFromOverwrites the surface with other's.
voidResetInPlaceBack to a default-constructed surface IN PLACE — the object, its address and its identity survive, so every Ref and every view keeps working.
uint64_tGetStableId
uint64_tGetStateVersionMoves on every write to the surface (any setter, CopyFrom, ResetInPlace, ResetToParent), including writes inside an FTransparentWriteScope.
voidSetBaseColor
Vec4GetBaseColor
const Vec4&GetLocalBaseColor
Vec3GetAverageTextureColorLinear-space average of the albedo texture (white when untextured or the average is unknown).
floatGetAverageTextureAlphaLinear average of the albedo texture's ALPHA channel (1 when untextured/unknown).
voidSetMetallic
floatGetMetallic
floatGetLocalMetallic
voidSetRoughness
floatGetRoughness
floatGetLocalRoughness
voidSetAO
floatGetAO
floatGetLocalAO
voidSetOpacity
floatGetOpacity
boolIsTransparentTranslucent 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.
voidSetAlphaBlendedBlended 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.
boolIsAlphaBlended
voidSetBlendModeHow a translucent surface combines with what is behind it.
EMaterialBlendModeGetBlendMode
voidSetAlphaMaskedAlpha-masked (cutout) rendering — foliage/fences: the GBuffer and shadow passes clip pixels whose albedo alpha falls below the cutoff instead of blending.
boolIsAlphaMasked
voidSetAlphaCutoff
floatGetAlphaCutoff
voidSetDoubleSidedDouble-sided: rendered with backface culling off (leaf cards, cloth).
boolIsDoubleSided
voidSetEmissiveColor
Vec3GetEmissiveColor
const Vec3&GetLocalEmissiveColor
voidSetEmissiveStrength
floatGetEmissiveStrength
floatGetLocalEmissiveStrength
voidSetSpecularColorLegacy specular properties (for backward compatibility)
const Vec3&GetSpecularColor
voidSetShininess
floatGetShininess
voidSetAlbedoTexInstance 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
voidSetNormalTex
Ref<Texture2D>GetNormalTex
voidSetMetallicRoughnessTex
Ref<Texture2D>GetMetallicRoughnessTex
voidSetAOTex
Ref<Texture2D>GetAOTex
voidSetEmissiveTex
Ref<Texture2D>GetEmissiveTex
voidSetOpacityTexStandalone 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
voidSetDetailAlbedoTexDetail maps — overlaid on primary albedo / normal at close range.
Ref<Texture2D>GetDetailAlbedoTex
voidSetDetailNormalTex
Ref<Texture2D>GetDetailNormalTex
voidSetMaskMapTexMask 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
voidSetDetailTiling
const Vec2&GetDetailTiling
voidSetDetailAlbedoStrength
floatGetDetailAlbedoStrength
voidSetDetailNormalStrength
floatGetDetailNormalStrength
voidSetHeightTexParallax Occlusion Mapping.
Ref<Texture2D>GetHeightTex
voidSetParallaxHeightScale
floatGetParallaxHeightScale
voidSetDisplacementMagnitude
floatGetDisplacementMagnitude
voidSetDisplacementCenter
floatGetDisplacementCenter
voidSetClearCoatIntensityClear coat — a second specular lobe on top of the base BRDF, modeling a thin transparent lacquer layer (car paint, painted wood, soda cans).
floatGetClearCoatIntensity
voidSetClearCoatRoughness
floatGetClearCoatRoughness
voidSetAnisotropyAnisotropy — stretches the specular highlight along the surface tangent (positive) or bitangent (negative).
floatGetAnisotropy
voidSetSubsurfaceStrengthSubsurface scattering — fakes the warm glow on the shadow-side of skin / wax / foliage by softening the diffuse terminator and tinting with albedo.
floatGetSubsurfaceStrength
voidSetIridescenceIntensityIridescence — thin-film interference giving hue shifts based on view angle.
floatGetIridescenceIntensity
voidSetHairHair shading model — switches the lighting pass to an anisotropic Kajiya-Kay strand model (dual shifted specular lobes) instead of GGX, for hair/fur cards.
boolIsHair
voidSetShadingModelExplicit shading model (G2).
EShadingModelGetShadingModel
EShadingModelGetEffectiveShadingModel
voidSetTransmissionStrengthTwoSidedFoliage transmission: how much light bleeds through the surface from behind, tinted by albedo.
floatGetTransmissionStrength
voidSetSheenIntensityCloth sheen: how much of the Charlie retro-reflective lobe rides on top of the base diffuse.
floatGetSheenIntensity
voidSetEyeParamsEye's parameters.
const FEyeSurfaceParams&GetEyeParams
uint32_tGetTextureVersion
boolHasAnyTextureUses the fallback getters so an instance counts textures inherited from its parent (not just its own overrides).
voidSetTerrainSplatTerrain splat: the GBuffer draws this material through the TERRAIN_SPLAT pipeline — vertex color = 4 layer weights over the albedo/detailAlbedo/detailNormal/maskMap image slots.
boolIsTerrainSplat
voidSetFoliageWindFoliage 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).
boolIsFoliageWind
voidSetWindParams
const Vec2&GetWindDirection
floatGetWindStrength
floatGetWindSpeed
voidSetReflectiveReflective 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.
boolIsReflective
voidSetWaterWater: the transparent pass draws this material through the WATER pipeline — Gerstner vertex displacement + fresnel shading.
boolIsWater
voidSetWaterWaveParams
voidSetWaterTime
floatGetWaterTime
const Vec2&GetWaveDirection
floatGetWaveAmplitude
floatGetWaveLength
floatGetWaveSteepness
floatGetWaveSpeed
voidSetWorldGridWorld grid: the albedo becomes the procedural grid and the albedo texture is ignored.
boolIsWorldGrid
voidSetWorldGridParams
const FWorldGridParams&GetWorldGridParams
Vec4PackWorldGridDetailParamsDetailParams of a grid draw: x = major cell, y = minor cell (metres, clamped away from zero), z/w = major/minor line shades.
voidSetPhysicsMaterialPathThe physics surface.
voidSetPhysicsSurfaceName
const std::string&GetLocalPhysicsMaterialPath
const std::string&GetLocalPhysicsSurfaceName
const std::string&GetPhysicsMaterialPath
const std::string&GetPhysicsSurfaceName
boolHasAuthoredPhysicsWhether anyone authored a physics answer at all.
voidSetName
const std::string&GetName
voidSetParent
Material*GetParent
boolIsInstance
MaterialOverrideGetOverrideFlags
boolHasOverride
voidSetOverride
voidClearAllOverrides
voidResetToParent
Ref<Material>CreateInstanceThe 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>CreateWorldGridThe engine default surface: a mid-grey world grid, rough dielectric.
voidSetGraphShaderIdCompiled material graph (UE5-gap Q1).
const std::string&GetGraphShaderId
boolHasGraphShader
uint64_tGetGraphShaderHashThe 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_tHashGraphShaderIdThe 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.
voidSetGraphHasWpoG4: whether the graph links a World Position Offset.
boolHasGraphWpo
voidSetGraphWpoBoundConservative world-space bound on |WPO| from the graph compile (0 = no WPO; a huge sentinel = unboundable subtree).
floatGetGraphWpoBound
voidSetSubstrateTopThe 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_tGetSubstrateTop
voidSetGraphTextures
const std::vector<Ref<Texture2D>>&GetGraphTextures
voidSetGraphArraySlotMaskBit i = the graph samples slot i as a Texture2DArray (CompiledShader:: arraySlotMask).
uint32_tGetGraphArraySlotMask
voidSetGraphParamLaneR4: the runtime parameter lanes the graph pipelines push per draw.
Vec4GetGraphParamLane
voidSetGraphParamLaneCount
uint32_tGetGraphParamLaneCount
const Vec4*GetGraphParams
const std::vector<Vec4>&GetGraphParamsExt

Function details

Material

C++
Material() = default

~Material

C++
~Material() override

Material

C++
Material(const Material&) = delete

A 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=

C++
Material& operator=(const Material&) = delete

Create

C++
static Ref<Material> Create()

Clone

C++
Ref<Material> Clone() const

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.

CopyFrom

C++
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

C++
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

C++
uint64_t GetStableId() const

GetStateVersion

C++
uint64_t GetStateVersion() const

Moves 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

C++
void SetBaseColor(const Vec4& color)

GetBaseColor

C++
Vec4 GetBaseColor() const

GetLocalBaseColor

C++
const Vec4& GetLocalBaseColor() const

GetAverageTextureColor

C++
Vec3 GetAverageTextureColor() const

Linear-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

C++
float GetAverageTextureAlpha() const

Linear 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

C++
void SetMetallic(float metallic)

GetMetallic

C++
float GetMetallic() const

GetLocalMetallic

C++
float GetLocalMetallic() const

SetRoughness

C++
void SetRoughness(float roughness)

GetRoughness

C++
float GetRoughness() const

GetLocalRoughness

C++
float GetLocalRoughness() const

SetAO

C++
void SetAO(float ao)

GetAO

C++
float GetAO() const

GetLocalAO

C++
float GetLocalAO() const

SetOpacity

C++
void SetOpacity(float opacity)

GetOpacity

C++
float GetOpacity() const

IsTransparent

C++
bool IsTransparent() const

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.

SetAlphaBlended

C++
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

C++
bool IsAlphaBlended() const

SetBlendMode

C++
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

C++
EMaterialBlendMode GetBlendMode() const

SetAlphaMasked

C++
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

C++
bool IsAlphaMasked() const

SetAlphaCutoff

C++
void SetAlphaCutoff(float cutoff)

GetAlphaCutoff

C++
float GetAlphaCutoff() const

SetDoubleSided

C++
void SetDoubleSided(bool doubleSided)

Double-sided: rendered with backface culling off (leaf cards, cloth).

IsDoubleSided

C++
bool IsDoubleSided() const

SetEmissiveColor

C++
void SetEmissiveColor(const Vec3& color)

GetEmissiveColor

C++
Vec3 GetEmissiveColor() const

GetLocalEmissiveColor

C++
const Vec3& GetLocalEmissiveColor() const

SetEmissiveStrength

C++
void SetEmissiveStrength(float strength)

GetEmissiveStrength

C++
float GetEmissiveStrength() const

GetLocalEmissiveStrength

C++
float GetLocalEmissiveStrength() const

SetSpecularColor

C++
void SetSpecularColor(const Vec3& color)

Legacy specular properties (for backward compatibility)

GetSpecularColor

C++
const Vec3& GetSpecularColor() const

SetShininess

C++
void SetShininess(float shininess)

GetShininess

C++
float GetShininess() const

SetAlbedoTex

C++
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

C++
Ref<Texture2D> GetAlbedoTex() const

SetNormalTex

C++
void SetNormalTex(Ref<Texture2D> tex)

GetNormalTex

C++
Ref<Texture2D> GetNormalTex() const

SetMetallicRoughnessTex

C++
void SetMetallicRoughnessTex(Ref<Texture2D> tex)

GetMetallicRoughnessTex

C++
Ref<Texture2D> GetMetallicRoughnessTex() const

SetAOTex

C++
void SetAOTex(Ref<Texture2D> tex)

GetAOTex

C++
Ref<Texture2D> GetAOTex() const

SetEmissiveTex

C++
void SetEmissiveTex(Ref<Texture2D> tex)

GetEmissiveTex

C++
Ref<Texture2D> GetEmissiveTex() const

SetOpacityTex

C++
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

C++
Ref<Texture2D> GetOpacityTex() const

SetDetailAlbedoTex

C++
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

C++
Ref<Texture2D> GetDetailAlbedoTex() const

SetDetailNormalTex

C++
void SetDetailNormalTex(Ref<Texture2D> tex)

GetDetailNormalTex

C++
Ref<Texture2D> GetDetailNormalTex() const

SetMaskMapTex

C++
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

C++
Ref<Texture2D> GetMaskMapTex() const

SetDetailTiling

C++
void SetDetailTiling(const Vec2& tiling)

GetDetailTiling

C++
const Vec2& GetDetailTiling() const

SetDetailAlbedoStrength

C++
void SetDetailAlbedoStrength(float v)

GetDetailAlbedoStrength

C++
float GetDetailAlbedoStrength() const

SetDetailNormalStrength

C++
void SetDetailNormalStrength(float v)

GetDetailNormalStrength

C++
float GetDetailNormalStrength() const

SetHeightTex

C++
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

C++
Ref<Texture2D> GetHeightTex() const

SetParallaxHeightScale

C++
void SetParallaxHeightScale(float v)

GetParallaxHeightScale

C++
float GetParallaxHeightScale() const

SetDisplacementMagnitude

C++
void SetDisplacementMagnitude(float v)

GetDisplacementMagnitude

C++
float GetDisplacementMagnitude() const

SetDisplacementCenter

C++
void SetDisplacementCenter(float v)

GetDisplacementCenter

C++
float GetDisplacementCenter() const

SetClearCoatIntensity

C++
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

C++
float GetClearCoatIntensity() const

SetClearCoatRoughness

C++
void SetClearCoatRoughness(float v)

GetClearCoatRoughness

C++
float GetClearCoatRoughness() const

SetAnisotropy

C++
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

C++
float GetAnisotropy() const

SetSubsurfaceStrength

C++
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

C++
float GetSubsurfaceStrength() const

SetIridescenceIntensity

C++
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

C++
float GetIridescenceIntensity() const

SetHair

C++
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

C++
bool IsHair() const

SetShadingModel

C++
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

C++
EShadingModel GetShadingModel() const

GetEffectiveShadingModel

C++
EShadingModel GetEffectiveShadingModel() const

SetTransmissionStrength

C++
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

C++
float GetTransmissionStrength() const

SetSheenIntensity

C++
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

C++
float GetSheenIntensity() const

SetEyeParams

C++
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

C++
const FEyeSurfaceParams& GetEyeParams() const

GetTextureVersion

C++
uint32_t GetTextureVersion() const

HasAnyTexture

C++
bool HasAnyTexture() const

Uses the fallback getters so an instance counts textures inherited from its parent (not just its own overrides).

SetTerrainSplat

C++
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

C++
bool IsTerrainSplat() const

SetFoliageWind

C++
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

C++
bool IsFoliageWind() const

SetWindParams

C++
void SetWindParams(const Vec2& direction, float strength, float speed)

GetWindDirection

C++
const Vec2& GetWindDirection() const

GetWindStrength

C++
float GetWindStrength() const

GetWindSpeed

C++
float GetWindSpeed() const

SetReflective

C++
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

C++
bool IsReflective() const

SetWater

C++
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

C++
bool IsWater() const

SetWaterWaveParams

C++
void SetWaterWaveParams(const Vec2& direction, float amplitude, float wavelength, float steepness, float speed)

SetWaterTime

C++
void SetWaterTime(float time)

GetWaterTime

C++
float GetWaterTime() const

GetWaveDirection

C++
const Vec2& GetWaveDirection() const

GetWaveAmplitude

C++
float GetWaveAmplitude() const

GetWaveLength

C++
float GetWaveLength() const

GetWaveSteepness

C++
float GetWaveSteepness() const

GetWaveSpeed

C++
float GetWaveSpeed() const

SetWorldGrid

C++
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

C++
bool IsWorldGrid() const

SetWorldGridParams

C++
void SetWorldGridParams(const FWorldGridParams& params)

GetWorldGridParams

C++
const FWorldGridParams& GetWorldGridParams() const

PackWorldGridDetailParams

C++
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

C++
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

C++
void SetPhysicsSurfaceName(const std::string& name)

GetLocalPhysicsMaterialPath

C++
const std::string& GetLocalPhysicsMaterialPath() const

GetLocalPhysicsSurfaceName

C++
const std::string& GetLocalPhysicsSurfaceName() const

GetPhysicsMaterialPath

C++
const std::string& GetPhysicsMaterialPath() const

GetPhysicsSurfaceName

C++
const std::string& GetPhysicsSurfaceName() const

HasAuthoredPhysics

C++
bool HasAuthoredPhysics() const

Whether 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

C++
void SetName(const std::string& name)

GetName

C++
const std::string& GetName() const

SetParent

C++
void SetParent(Material* parent)

GetParent

C++
Material* GetParent() const

IsInstance

C++
bool IsInstance() const

GetOverrideFlags

C++
MaterialOverride GetOverrideFlags() const

HasOverride

C++
bool HasOverride(MaterialOverride flag) const

SetOverride

C++
void SetOverride(MaterialOverride flag, bool enabled)

ClearAllOverrides

C++
void ClearAllOverrides()

ResetToParent

C++
void ResetToParent(MaterialOverride flag)

CreateInstance

C++
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

C++
static Ref<Material> CreateDefault()

CreateColored

C++
static Ref<Material> CreateColored(const Vec4& color)

CreateMetallic

C++
static Ref<Material> CreateMetallic(const Vec4& baseColor, float shininess = 64.0f)

CreateMatte

C++
static Ref<Material> CreateMatte(const Vec4& baseColor)

CreatePBR

C++
static Ref<Material> CreatePBR(const Vec4& baseColor, float metallic, float roughness, float ao = 1.0f)

CreatePBRMetal

C++
static Ref<Material> CreatePBRMetal(const Vec4& baseColor, float roughness = 0.3f)

CreatePBRDielectric

C++
static Ref<Material> CreatePBRDielectric(const Vec4& baseColor, float roughness = 0.5f)

CreateWorldGrid

C++
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

C++
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

C++
const std::string& GetGraphShaderId() const

HasGraphShader

C++
bool HasGraphShader() const

GetGraphShaderHash

C++
uint64_t GetGraphShaderHash() const

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.

HashGraphShaderId

C++
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

C++
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

C++
bool HasGraphWpo() const

SetGraphWpoBound

C++
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

C++
float GetGraphWpoBound() const

SetSubstrateTop

C++
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

C++
uint32_t GetSubstrateTop() const

SetGraphTextures

C++
void SetGraphTextures(std::vector<Ref<Texture2D>> textures)

GetGraphTextures

C++
const std::vector<Ref<Texture2D>>& GetGraphTextures() const

SetGraphArraySlotMask

C++
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

C++
uint32_t GetGraphArraySlotMask() const

SetGraphParamLane

C++
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

C++
Vec4 GetGraphParamLane(uint32_t lane) const

SetGraphParamLaneCount

C++
void SetGraphParamLaneCount(uint32_t lanes)

GetGraphParamLaneCount

C++
uint32_t GetGraphParamLaneCount() const

GetGraphParams

C++
const Vec4* GetGraphParams() const

GetGraphParamsExt

C++
const std::vector<Vec4>& GetGraphParamsExt() const
Generated from Renderer/Material.h via renderer.json · Nov 4, 2026Version 1.0.0