enum

MatNodeType

Node-based material authoring. A MaterialGraph is a set of expression nodes feeding a single Material Output node whose input slots map to the fixed PBR channels the renderer already consumes (base color, metallic, roughness, normal, emissive, AO, opacity + the extended flags). The graph is stored inside the .mdfmat next to the flat PBR fields. There are two compile products: EmitCompiledShader emits a real per-material HLSL evaluator the cook compiles into per-graph blobs, and Compile() folds the same graph down to the flat fields, which stay the fallback whenever a blob is missing. Texture-sample nodes assign a texture slot; constant/param/math nodes constant-fold into scalar/vector channel values.

Module
AssetSystem
Header
#include "AssetSystem/Assets/MaterialGraph.h"
Namespace
Mowo

Values

NameValueDescription
Output0
ConstScalar
ConstColor
ScalarParam
VectorParam
TextureSample
UV
Time
Panner
Add
Mul
Lerp
Dot
Normalize
Fresnel
NormalMap
OneMinus
Mask
SaturateG1 batch — parameters ride EXISTING node fields so serialization stays untouched: Power exp = scalar (fallback when pin 1 unbound), Clamp min/max = panSpeed.xy, Rotator speed(rad/s) = scalar, TilingOffset tiling = panSpeed / offset = color.xy, ValueNoise scale = scalar.
Power
Clamp
Sine
Length
WorldNormal
ViewDir
Rotator
TilingOffset
ValueNoise
WorldPositionG4: world-space position of the evaluated point — pixel stage reads the interpolated WorldPos, the vertex stage the pre-offset vertex.
CustomHLSLG1: user-authored HLSL (UE Custom node). The code body rides the existing paramName string field (serialization untouched); it becomes float4 MatCustom_<id>(float4 In0..In3, FMaterialInputs In) { <code> } — write a return, read the four inputs and any FMaterialInputs field. Never constant-folds; compile errors surface at cook with the usual warn-and-fall-back-to-uber path.
VertexColorG1: the mesh's per-vertex colour, interpolated. Live in every pass the graph runs in (GBuffer, forward, masked shadow depth, velocity/WPO); post-domain materials have no geometry and read white. Folds to white too, so a graph that only multiplies by it is identity by default.
MakeMaterialAttributesLayered materials (UE's material layers). These two node kinds carry a whole surface along the wire instead of a float4 — a "layer bus". A MakeMaterialAttributes packs the seven PBR channels into one; a LayerBlend crossfades two of them under a mask, and chaining blends stacks arbitrarily many layers. Every layer compiles into the SAME per-material shader (one draw, one pipeline, no extra push bytes and no descriptor churn) — the whole point of the feature is that N layers cost one pass, not N. The two buses are NOT interchangeable: a float4 wired into a layer pin, or a layer wired into a float4 pin, is refused at compile time rather than silently coerced. Coercion would produce a material that renders plausibly and wrongly, which is the failure this rejection exists to prevent. Fields reused so serialization stays untouched: MakeMaterialAttributes takes its unconnected-pin fallbacks from the same out*/color fields the Output node uses; LayerBlend's scalar is the height-blend transition width in height units (only read when the Height pin is connected).
LayerBlend
MaterialFunctionCallMaterial functions (UE's MaterialFunction). A call node names a .mmatfunc asset by path (functionPath) and exposes one input pin per Function Input node the function declares, in that function's node order; its single output is the function's Function Output. The call is INLINED at compile time — MaterialGraph::Resolve splices the function's nodes into the caller with fresh ids and rewires the pins — so the emitter, the fold and the WPO bound walk never see a call at all and a function costs exactly what its body costs. Recursion (a function that reaches itself through any chain of calls) is refused with an error that names the cycle; without that check the resolver would expand forever. Inside a function: FunctionInput carries the pin name in paramName, its unconnected-caller default in color (a scalar input reads .x) and its type in scalarPin; FunctionOutput takes the result on slot 0 and names it in paramName. Reached outside a function (the function editor's own compile) an input reads its default and an output passes through.
FunctionInput
FunctionOutput
StaticSwitchStatic switches (UE's StaticSwitchParameter). A StaticSwitch picks True (slot 0) or False (slot 1) at COMPILE time from the StaticBool wired into its Value pin (slot 2), or from its own boolValue when the pin is unwired. The unselected branch is never visited: it emits no code, takes no texture slot and no parameter lane. Every NAMED StaticBool is one permutation axis — 2^N shader permutations, each its own source and hash, bounded by r.Material.MaxStaticPermutations. A material instance overrides the bool by name and thereby selects its permutation. An unnamed StaticBool is a constant, not an axis.
StaticBool
SubstrateSlabSubstrate: a second BSDF slab layered over the material's own surface. A slab is albedo / F0 / roughness / normal / coverage, and layering one over another is what the fixed shading models cannot express — each of them spends the single custom G-Buffer scalar on a different thing, so clear-coat-over-cloth has nowhere to live. Slice 1 encodes exactly two slabs and the bottom one IS the ordinary surface (RT0/RT1), so this node authors the TOP slab. There is still no VERTICAL stacking node: with two encodable slabs and the bottom one taken, stacking two authored slabs needs three and every use would be a compile error. That waits on the payload target — Documentation/ROADMAP.md §12.4. Coverage/Roughness/F0 are pins; the albedo is a two-bit codebook on the node (maskChannel) because sixteen bits cannot hold an independent RGB. The slab shares the base slab's normal for the same reason.
SubstrateBlendTwo slab definitions crossfaded under a mask, resolving to ONE slab before the encode. This is the side-by-side case, not the vertical one: its output is a single slab by construction, so it cannot produce a stack that does not fit and needs no extra G-Buffer bits. What it buys is a coat whose CHARACTER varies across the surface and not only its thickness — ice on the ledges and powder in the crevices of one rock, wax on a jacket's shoulders and bare fuzz elsewhere — which today needs two materials and a mesh split. The albedo codebook entry is the one thing it cannot blend: the mode is two bits baked into the shader as a define, so the emitter refuses a blend whose two slabs disagree about it rather than silently keeping one.
SceneDepthScene inputs (UE's SceneDepth / CustomDepth / CustomStencil): the scene's device depth, the custom depth pass's depth and its stencil value at the evaluated pixel. Pin 0 is an optional screen UV (defaults to the pixel's own). Live in the post-process domain, where the pass binds the three targets; the surface domains carry no frame block for them and read zero. Fold to zero — a screen-space value has no constant.
CustomDepth
CustomStencil
TextureSampleArrayA Texture2DArray sample (UE's Texture Sample on a texture array): pin 0 is the UV, pin 1 the layer index (the .x of whatever is wired, rounded to the nearest layer and clamped by the hardware; unwired it is the node's scalar, so a constant layer needs no extra node). The texture UUID names an array texture asset (FTextureArrayBuilder). Each layer has its own mip chain, so unlike an atlas a layer never bleeds into its neighbour. A per-vertex layer comes from a Vertex Color channel times the layer count. Takes one of the eight material texture slots but never slot 6 (the Height slot, which the uber shader reads through methods only a 2D texture has). Live in the GBuffer, forward and masked-shadow templates; the decal, post-process and light-function templates read white from it. Folds to white, and is refused inside a World Position Offset subtree like every texture read.
Count
Generated from AssetSystem/Assets/MaterialGraph.h via assetsystem.json · Nov 4, 2026Version 1.0.0