struct
FSubstrateCodec
The two-slab G-Buffer codec, mirrored from Engine/Shaders/Private/Lighting/ Substrate.hlsli. Slab 0 is the ordinary G-Buffer; this describes slab 1, which rides the sixteen bits the tier-7 escape frees from clear-coat duty. The shader and this struct are pinned against each other by the substrate-codec-test row — a bit layout with two writers and no test is how the anisotropy nibble drifted before it was centralised.
- Module
- AssetSystem
- Header
#include "AssetSystem/Assets/MaterialGraph.h"- Namespace
Mowo
Properties
| Type | Name | Description |
|---|---|---|
static constexpr uint32_t | ExtendedSlot | Tier 7's low five bits name an extended slot; slot 1 is Eye, so Substrate takes slot 2 and shading-model id 9. Renderer/Material.h has no EShadingModel entry for it yet (that header is outside the material path), so this is where the reservation lives. Default 2u. |
static constexpr uint32_t | ModelId | Default 9u. |
static constexpr uint32_t | Rt3aByte | Default 0xE2u. |
static constexpr uint32_t | MaxSlabs | Two slabs, fixed. Not a budget knob yet: widening it needs a G-Buffer target, which is a renderer-owned change (plan §2). Default 2u. |
static constexpr float | SheenTint | Default 0.35f. |
Public functions
| Returns | Name | Description |
|---|---|---|
float | F0FromCode | |
uint32_t | F0ToCode | |
uint32_t | PackTop | |
float | UnpackCoverage | |
float | UnpackRoughness | |
float | UnpackF0 | |
uint32_t | UnpackAlbedoMode | |
float | Rt3R | RT3.R/G are UNORM bytes. |
float | Rt3G | |
uint32_t | FromRt3 |
Function details
F0FromCode
C++
static float F0FromCode(uint32_t code)F0ToCode
C++
static uint32_t F0ToCode(float f0)PackTop
C++
static uint32_t PackTop(float coverage, float roughness, float f0, uint32_t albedoMode)UnpackCoverage
C++
static float UnpackCoverage(uint32_t packed)UnpackRoughness
C++
static float UnpackRoughness(uint32_t packed)UnpackF0
C++
static float UnpackF0(uint32_t packed)UnpackAlbedoMode
C++
static uint32_t UnpackAlbedoMode(uint32_t packed)Rt3R
C++
static float Rt3R(uint32_t packed)RT3.R/G are UNORM bytes. The +0.5 on the way back is load-bearing: a UNORM round-trip of 200/255 lands at 0.78431375 and truncating gives 199.
Rt3G
C++
static float Rt3G(uint32_t packed)FromRt3
C++
static uint32_t FromRt3(float r, float g)Generated from AssetSystem/Assets/MaterialGraph.h via assetsystem.json · Nov 4, 2026Version 1.0.0