Rendering — game thread → render thread → RHI → GPU
Unreal's rendering architecture is a four-stage pipeline split across threads. Gameplay code in Tick prepares data on the game thread. The render thread assembles draw commands. The RHI thread translates them into the platform API (DX12/Vulkan/Metal). The GPU executes. Every step is a potential bottleneck — and without knowing which one, optimisation is guesswork.
The big architectural rule: the render thread lags the game thread by N frames. So you cannot "read a render result in Tick" — the data doesn't exist yet. Every query has to be async (FRenderCommandFence, ENQUEUE_RENDER_COMMAND).
Materials are node graphs, compiled to HLSL, then to platform-specific shaders. A complex material can cost tens of thousands of instructions per pixel. The classic trap is judging material cost by visual complexity; the right tool is the Shader Complexity overlay + stat gpu.
Topic map
- Rendering architecture — game/render/RHI thread, deferred shading, render passes, RHI as the hardware-abstraction layer.
- Material fundamentals — Material vs MaterialInstance, domain, blend mode, shading model.
- Material performance — instruction count, samplers, dependent texture reads, the Shader Complexity overlay.
- Shader compilation — DDC, permutations, async compile, cook-time vs runtime.
- Performance diagnostics —
stat unit,stat gpu, GPU Profiler, Unreal Insights.
Common traps
| Mistake | Consequence |
|---|---|
| Treating FPS as the only metric | Cannot distinguish CPU vs GPU bottleneck |
| Creating hundreds of unique Materials instead of MaterialInstances | Each is its own permutation; brutal compile times |
| Texture sample in a loop inside a material | Dependent texture reads — much more expensive |
Setting Translucent blend mode on large meshes | Translucency does forward-shading work — slow |
Reading render state from Tick | At least 1-frame lag, race conditions |
| Eyeballing material complexity | Shader Complexity overlay shows real cost |
| Not using MaterialInstance | Shader recompiles on every tweak |
| Ignoring lightmap resolution | Pre-baked lighting memory explodes |
Interview relevance
Rendering is a senior UE topic. Checks:
- The difference between
stat unitand FPS and how to read it (Game / Draw / GPU lines). - What "CPU-bound vs GPU-bound" means and how to identify it.
- The difference between Material and MaterialInstance.
- What a shader permutation is and why shader compilation is "slow".
- How deferred shading differs from forward (and why UE is deferred by default).
Common wrong answer: "Low FPS — need a better GPU." The real answer: without stat unit you cannot tell whether you're bound on the game thread (CPU logic), the render thread (draw calls), or the GPU (pixel shader cost). Each demands a different fix.