Graphics › The frame
How an engine draws a frame: passes and the G-buffer
Know first: Shader: a function for every pixel, Surface properties: roughness, metallic, AO, Depth buffer: what is closer to the camera, Transparency: Opaque, Masked, Translucent
A frame in a game is a chain of dozens of passes. Each pass draws its own image, and later passes read it. The chain has one big fork. You can light each object while it is being drawn. Or you can first fill in a form of surface properties for every pixel, the G-buffer, and compute the light afterward. That choice decides how Buffer Visualization works, how glass is lit, and what a hundred lamps cost. This is lesson five of the course “How an engine draws a frame.”
Why this matters
You have already met the depth prepass and the rule that transparent objects are drawn after the opaque ones. This lesson puts the whole frame together. Without that picture, several things stay unexplained:
- where the Base Color, World Normal, Roughness and Scene Depth images in the Unreal viewport menu come from;
- why a material has a fixed set of outputs, when a shader could compute anything;
- why glass gets simpler lighting than the stone beside it, and why a decal does not land on glass;
- why one engine can switch on a hundred lamps, while in another an object gets no more than eight.