MASTER · one graph, many instancesMASTER · jeden graf, wiele instancjiSHADING MODEL · a list, not a stackSHADING MODEL · lista, nie stosREFERENCE · the path tracerREFERENCJA · path tracer
Chapter 25 / Realtime lookdevRozdział 25 / Lookdev realtime

Unreal Engine 5 in practiceUnreal Engine 5 w praktyce

The Material Editor looks like Hypershade and behaves nothing like it: here a shader graph is a compiled program with a fixed output contract, and the artist-facing work happens one level above it, in instances. Material Editor wygląda jak Hypershade i zachowuje się zupełnie inaczej: tutaj graf shadera to skompilowany program o stałym kontrakcie wyjścia, a praca artysty dzieje się o poziom wyżej — w instancjach.

TL;DR
Stage: Master and instancesEtap: Master i instancje

Why one graph serves a hundred assetsDlaczego jeden graf obsługuje sto assetów

A master material is a node graph that Unreal compiles into a shader program, once per platform and once per combination of its static switches (the permutations of Chapter 24). A Material Instance is not a copy of that graph — it is a small table of overridden parameter values pointing at the same compiled program. Swapping a texture or nudging roughness in an instance is free at build time and nearly free at run time; adding a node to the master is neither. Master material to graf węzłów, który Unreal kompiluje do programu shaderowego — raz na platformę i raz na każdą kombinację przełączników statycznych (permutacje z Rozdziału 24). Material Instance nie jest kopią tego grafu — to mała tablica nadpisanych wartości parametrów wskazująca ten sam skompilowany program. Podmiana tekstury albo poprawka roughness w instancji jest darmowa na etapie builda i prawie darmowa w czasie działania; dodanie węzła do mastera nie jest ani jednym, ani drugim.

This inverts the VFX workflow. In Arnold, per-asset shader networks are normal and the cost of one more node is a few milliseconds of a render that already takes minutes. In Unreal, the equivalent habit multiplies shader compilation times, memory and draw-call state changes across the whole project. The discipline that replaces it: design a small number of masters by material family — the same families this book has been building since Chapter 13 (opaque dielectric, metal, layered/coated, skin, cloth, hair, glass) — expose their parameters, and do all per-asset work in instances. To odwraca workflow z VFX. W Arnoldzie sieci shaderów per asset są normą, a koszt jednego węzła więcej to kilka milisekund renderu, który i tak trwa minuty. W Unrealu ten sam nawyk mnoży czasy kompilacji shaderów, pamięć i zmiany stanu przy draw callach w skali całego projektu. Dyscyplina, która to zastępuje: zaprojektuj niewielką liczbę masterów według rodzin materiałowych — tych samych rodzin, które ta książka buduje od Rozdziału 13 (nieprzezroczysty dielektryk, metal, warstwowy z coatem, skóra, tkanina, włosy, szkło) — wystaw ich parametry i całą pracę per asset rób w instancjach.

Two mechanisms make the masters themselves maintainable. Material Functions are reusable subgraphs — the direct analogue of a MaterialX nodegraph or an OSL utility shader — so a channel-packing convention or a detail-normal blend is authored once and referenced everywhere. Material Layers (layer and layer-blend assets) let an instance stack authored layers, which is how a "layered material" is normally built for artists in Unreal, distinct from Substrate's shading-level layering below. Dwa mechanizmy sprawiają, że same mastery pozostają utrzymywalne. Material Functions to reużywalne podgrafy — bezpośredni odpowiednik nodegraphu MaterialX albo pomocniczego shadera OSL — dzięki czemu konwencja channel packingu albo miks detalowej normalnej powstaje raz i jest referencjonowana wszędzie. Material Layers (assety warstwy i miksu warstw) pozwalają instancji układać gotowe warstwy i tak zwykle buduje się w Unrealu „materiał warstwowy” dla artystów — co jest czymś innym niż warstwowanie na poziomie cieniowania w Substrate opisane niżej.

↓ raytracing-book, Appendix AI — MaterialX and OSL: how materials are described outside one engine’s node graph↓ raytracing-book, Dodatek AI — MaterialX i OSL: jak opisuje się materiały poza grafem jednego silnika
Master.and.instancesone compiled program, many parameter tablesjeden skompilowany program, wiele tablic parametrów
M_Master_DielectricM_Master_Dielectric node graph → compiled shadergraf węzłów → skompilowany shader + 1 variant per static switch+ 1 wariant na przełącznik statyczny MI_LeatherJacket rough 0,42 · 3 tex MI_PaintedWall rough 0,68 · 2 tex MI_PlasticCrate rough 0,25 · 2 tex changing this costs a recompilezmiana tutaj kosztuje rekompilację changing an instance below costs nothingzmiana w instancji poniżej nie kosztuje nic The VFX habit — one graph per asset — would draw three orange boxes instead of one.Nawyk z VFX — jeden graf na asset — narysowałby trzy pomarańczowe pudełka zamiast jednego.
Parameters exposed on the master become the instance's controls. Anything not exposed can only be changed by editing — and recompiling — the master itself.Parametry wystawione na masterze stają się kontrolkami instancji. Czego nie wystawiono, tego nie zmienisz bez edycji — i rekompilacji — samego mastera.
Stage: The Rosetta rowEtap: Wiersz Rosetty

The same parameters under a third set of namesTe same parametry pod trzecim zestawem nazw

Appendix N built a Rosetta table between Arnold and RenderMan. Unreal adds a third column, and reading it is mostly an exercise in recognising old friends — with two traps worth naming. First, Unreal's Specular input is not a specular colour or intensity in the Arnold sense: it is a remap of dielectric F0 around 0,04, and the correct value for almost every dielectric is the default 0,5. Second, Metallic is the metalness workflow of Chapter 14, with all its consequences — it is a switch, not a dial, and intermediate values are for transitions in a mask, not for "slightly metallic" materials. Dodatek N zbudował tabelę Rosetty między Arnoldem a RenderManem. Unreal dokłada trzecią kolumnę, a jej czytanie to głównie rozpoznawanie starych znajomych — z dwiema pułapkami wartymi nazwania. Po pierwsze, wejście Specular w Unrealu nie jest kolorem ani intensywnością specularu w rozumieniu Arnolda: to remap dielektrycznego F0 wokół 0,04, a poprawna wartość dla prawie każdego dielektryka to domyślne 0,5. Po drugie, Metallic to metalness workflow z Rozdziału 14, ze wszystkimi jego konsekwencjami — to przełącznik, nie pokrętło, a wartości pośrednie służą przejściom w masce, nie materiałom „lekko metalicznym”.

MeaningArnoldRenderManUnreal Engine 5
Diffuse albedobase_color × basediffuseColor × diffuseGainBase Color
Metal switchmetalnessArtistic/Physical modeMetallic
Dielectric F0specular_IORspecularIor / Face ColorSpecular (0,5 ⇒ F0 = 0,04)
Microfacet roughnessspecular_roughnessspecularRoughnessRoughness
Coat layercoat, coat_roughnessclearcoat*Clear Coat shading model, or a Substrate coat operator
Subsurfacesubsurface, subsurface_radiussubsurfaceGain, MFPSubsurface Profile asset
Emissionemission × emission_colorglowGainEmissive Color (in cd/m² when using physical light units)
Opacity cutoutopacitypresenceOpacity Mask + Masked blend mode
Displacementdisplacement shaderdisplacement shaderWorld Position Offset / Nanite tessellation
*RenderMan's coat lives in PxrSurface's clearcoat lobe; the table names intent, not identical maths — every engine approximates the coat differently at grazing angles.
ZnaczenieArnoldRenderManUnreal Engine 5
Albedo diffusebase_color × basediffuseColor × diffuseGainBase Color
Przełącznik metalumetalnesstryb Artistic/PhysicalMetallic
F0 dielektrykaspecular_IORspecularIor / Face ColorSpecular (0,5 ⇒ F0 = 0,04)
Roughness mikrofasetekspecular_roughnessspecularRoughnessRoughness
Warstwa coatcoat, coat_roughnessclearcoat*model Clear Coat albo operator coat w Substrate
Subsurfacesubsurface, subsurface_radiussubsurfaceGain, MFPasset Subsurface Profile
Emisjaemission × emission_colorglowGainEmissive Color (w cd/m² przy fizycznych jednostkach światła)
Wycinanie opacityopacitypresenceOpacity Mask + blend mode Masked
Displacementshader displacementshader displacementWorld Position Offset / teselacja Nanite
*Coat RenderMana siedzi w lobie clearcoat PxrSurface; tabela nazywa intencję, nie identyczną matematykę — każdy silnik inaczej przybliża coat przy kątach ślizgowych.
Stage: SubstrateEtap: Substrate

From a list of models to a stack of slabsOd listy modeli do stosu slabów

The fixed shading-model list is the part of Unreal that a lookdev artist coming from Chapter 15 misses most: there is no way, in the classic path, to put a thin coat over a cloth sheen over a metal base, because each of those is a whole model, and a pixel gets one. Substrate attacks exactly this. A material is built from slabs — parametrised BSDF layers — combined by operators: vertical layering (one slab under another, with coverage and transmission between them), horizontal blending (a mask picking between slabs, the way a texture mask picks between materials), and a dedicated coat. Zamknięta lista modeli cieniowania to część Unreala, której lookdev artysta po Rozdziale 15 brakuje najbardziej: w klasycznej ścieżce nie da się położyć cienkiego coatu nad sheenem tkaniny nad metaliczną bazą, bo każde z tych trzech jest całym modelem, a piksel dostaje jeden. Substrate atakuje dokładnie to. Materiał składa się ze slabów — sparametryzowanych warstw BSDF — łączonych operatorami: warstwowanie pionowe (jeden slab pod drugim, z pokryciem i transmisją między nimi), miks poziomy (maska wybierająca między slabami, tak jak maska tekstury wybiera między materiałami) i osobny coat.

Structurally this is the same idea as the closure stack of Chapter 15 and as MaterialX's layered shading — and the same trade-off appears immediately. Layers cost G-Buffer space, so Substrate projects carry a bytes-per-pixel budget and materials exceeding it get simplified. That budget is now part of lookdev: "how many slabs does this asset deserve" is a question with a memory answer, not only an aesthetic one. Substrate is enabled per project and, as of this writing, still carries migration caveats — it changes how existing materials shade, so it is a project-start decision, not a mid-production toggle. Strukturalnie to ta sama idea co stos closure'ów z Rozdziału 15 i co warstwowe cieniowanie w MaterialX — i natychmiast pojawia się ten sam kompromis. Warstwy kosztują miejsce w G-Bufferze, więc projekty na Substrate mają budżet bajtów na piksel, a materiały, które go przekraczają, są upraszczane. Ten budżet staje się częścią lookdevu: „ile slabów zasługuje ten asset” to pytanie z odpowiedzią pamięciową, nie tylko estetyczną. Substrate włącza się per projekt i — na moment pisania — wciąż niesie zastrzeżenia migracyjne: zmienia sposób cieniowania istniejących materiałów, więc to decyzja na start projektu, nie przełącznik w trakcie produkcji.

↓ raytracing-book, Appendix AC — the full maths of layered materials, the model Substrate’s slabs approximate↓ raytracing-book, Dodatek AC — pełna matematyka materiałów warstwowych, czyli modelu, który przybliżają slaby Substrate
Stage: Lumen and NaniteEtap: Lumen i Nanite

Two systems that quietly edit your materialDwa systemy, które po cichu redagują Twój materiał

Lumen supplies dynamic global illumination and reflections. Its relevance to lookdev is that it does not light your material from your material: it lights it from a lower-resolution proxy of the scene, the surface cache, which stores a simplified albedo, normal and emissive for nearby geometry. Two consequences bite regularly. Very dark albedos lose bounce light disproportionately, because the cache's simplification and the limited bounce count compound; and small, high-contrast emissive details may contribute far less indirect light than the path tracer says they should. Neither is a bug in your material — but both mean the material as-lit differs from the material as-authored. Lumen dostarcza dynamiczne oświetlenie globalne i odbicia. Dla lookdevu istotne jest to, że nie oświetla Twojego materiału Twoim materiałem: oświetla go niższej rozdzielczości proxy sceny — surface cache — które przechowuje uproszczone albedo, normalną i emisję pobliskiej geometrii. Dwie konsekwencje gryzą regularnie. Bardzo ciemne albedo traci światło odbite nieproporcjonalnie mocno, bo uproszczenie cache'u i limit odbić się kumulują; a drobne, kontrastowe detale emisyjne potrafią wnosić znacznie mniej światła pośredniego, niż mówi path tracer. Żadne z tego nie jest błędem Twojego materiału — ale oba oznaczają, że materiał oświetlony różni się od materiału zautorowanego.

Nanite virtualises geometry, and for materials it mainly imposes rules: opaque materials are the cheap, fully supported case; masked materials and world-position offset are supported but cost more and interact with how Nanite culls; translucency stays outside it. Nanite's tessellation, added later in the 5.x line, is the one path that turns a height map into real displaced geometry at run time — the realtime echo of Chapter 20, with the same warning attached: displacement is geometry, and geometry is a budget. Nanite wirtualizuje geometrię, a materiałom przede wszystkim narzuca reguły: materiały nieprzezroczyste to przypadek tani i w pełni wspierany; materiały masked i world position offset są wspierane, ale kosztują więcej i wchodzą w interakcję z tym, jak Nanite odrzuca niewidoczne fragmenty; transparencja zostaje poza nim. Teselacja Nanite, dodana później w linii 5.x, to jedyna ścieżka zamieniająca mapę wysokości w prawdziwie przesuniętą geometrię w czasie działania — realtime'owe echo Rozdziału 20, z tym samym ostrzeżeniem: displacement to geometria, a geometria to budżet.

Stage: Ground truthEtap: Referencja

The path tracer is your ArnoldPath tracer jest Twoim Arnoldem

Everything above is approximation, and approximation is only safe when you can measure it. Unreal's built-in path tracer renders the same scene, the same materials and the same lights with real transport, and switching between it and the realtime view is the engine's version of the A/B a lookdev artist does all day. Three checks pay for themselves immediately: energy (does a rough metal go dark in Lumen but not in the path tracer — a bounce-count artefact, not a material error), reflections (does a mirror-like surface lose its off-screen content — a screen-space fallback), and subsurface (does thin geometry stop transmitting — the profile approximation of Chapter 24's table). Wszystko powyżej to przybliżenie, a przybliżenie jest bezpieczne tylko wtedy, gdy da się je zmierzyć. Wbudowany path tracer Unreala renderuje tę samą scenę, te same materiały i te same światła z prawdziwym transportem, a przełączanie między nim a widokiem realtime to silnikowa wersja porównania A/B, które lookdev artysta robi cały dzień. Trzy sprawdzenia zwracają się natychmiast: energia (czy szorstki metal ciemnieje w Lumenie, a nie ciemnieje w path tracerze — artefakt limitu odbić, nie błąd materiału), odbicia (czy powierzchnia lustrzana gubi treść spoza ekranu — fallback ekranowy) i subsurface (czy cienka geometria przestaje przepuszczać światło — przybliżenie profilem z tabeli w Rozdziale 24).

The path tracer is also what makes an honest turntable possible inside the engine: render the Chapter 22 turntable twice, once realtime and once path traced, and the difference between them is the list of things the shipping renderer will approximate about your look. Path tracer umożliwia też uczciwy turntable wewnątrz silnika: wyrenderuj turntable z Rozdziału 22 dwa razy, raz w realtime i raz path tracingiem, a różnica między nimi jest listą rzeczy, które docelowy renderer przybliży w Twoim looku.

From practiceZ praktyki

Two numbers belong on screen while authoring a master material: the instruction count and the texture sampler count, both in the editor's stats. Samplers are the harder wall — a material has a small fixed number of them, and a graph that samples one texture per channel hits it long before it looks finished. That constraint is the reason for channel packing, which Chapter 27 treats properly. Also: check the material's cost in the shader-complexity view before, not after, the art director approves it. Dwie liczby powinny być na ekranie przy autorowaniu master materiału: liczba instrukcji i liczba samplerów tekstur, obie w statystykach edytora. Samplery to twardsza ściana — materiał ma ich małą, stałą liczbę, a graf próbkujący jedną teksturę na kanał uderza w nią na długo przed tym, jak zacznie wyglądać na skończony. To ograniczenie jest powodem channel packingu, którym porządnie zajmuje się Rozdział 27. I jeszcze: sprawdź koszt materiału w widoku złożoności shadera przed, a nie po akceptacji art directora.

GlossarySłowniczek
Master material / Material InstanceMaster material / Material Instance
A compiled shader graph, and a lightweight override of its exposed parameters that reuses the same compiled program.Skompilowany graf shadera i lekkie nadpisanie jego wystawionych parametrów, korzystające z tego samego skompilowanego programu.
Material Function / Material LayersMaterial Function / Material Layers
A reusable subgraph; and the asset pair (layer + blend) that lets an instance stack authored layers.Reużywalny podgraf; oraz para assetów (warstwa + miks) pozwalająca instancji układać gotowe warstwy.
Shading modelModel cieniowania
Unreal's per-material choice from a closed list, deciding how the G-Buffer slots are interpreted.Wybór per materiał z zamkniętej listy w Unrealu, decydujący o interpretacji slotów G-Buffera.
Substrate slab / operatorSlab / operator w Substrate
A parametrised BSDF layer, and the vertical/horizontal/coat combinators that assemble slabs into a material.Sparametryzowana warstwa BSDF oraz kombinatory pionowy/poziomy/coat składające slaby w materiał.
Lumen surface cacheSurface cache Lumena
The simplified albedo/normal/emissive proxy Lumen lights the scene from — not your full material.Uproszczone proxy albedo/normalnej/emisji, z którego Lumen oświetla scenę — nie Twój pełny materiał.
Specular input (UE)Wejście Specular (UE)
A remap of dielectric F0 around 0,04, default 0,5 — not a specular colour or intensity.Remap dielektrycznego F0 wokół 0,04, domyślnie 0,5 — nie kolor ani intensywność specularu.