3 ms·
3D objects are drawn using 3D triangles projected and interpolated on to the 2D screen (2D array of colors). Classically, you draw the whole triangle, start to
by corysama 6y ago
3D objects are drawn using 3D triangles projected and interpolated on to the 2D screen (2D array of colors).
Classically, you draw the whole triangle, start to finish in one go. Interpolate the triangle, look up any colors from textures, do the lighting math, write it all out. Simple and straightforward.
For complicated reasons, it often actually works out better for current games on current hardware (games/hardware of the past decade) to defer the lighting math and do it in a separate pass. So, interpolate the triangle, look up the textures, write all of the inputs to the lighting math (other than the lights themselves) to a multi-layer 2D array of parameters (surface color, normal, roughness, etc...). Then later determine which lights affect which pixels and accumulate the lighting using only the 2D parameter arrays --without needing the triangle information.
The multi-layer 2D arrays of material parameters is called the "G-Buffer". I think it originally stood for "Geometry Buffer". But, the name has taken on a life of it's own.