3 ms·
There are two types of rendering now in common use for games. In forward rendering you allocate one RGB color buffer for the screen, then rasterize triangles t
by modeless 6y ago
There are two types of rendering now in common use for games.
In forward rendering you allocate one RGB color buffer for the screen, then rasterize triangles to this buffer, directly producing final RGB color values at each pixel.
In deferred rendering instead of one RGB color buffer you allocate a set of screen-sized buffers to hold various attributes of your choosing for each pixel, which can include colors but also things like the surface normal, material type, roughness, velocity, etc. These buffers are collectively referred to as the G-buffer. When you rasterize triangles you fill in all the attributes for each pixel instead of just a final color. Then in a second full screen pass, for each pixel you read all the surface attributes you wrote earlier and combine them with other data such as the positions of nearby lights, do some calculations and output the final color.
By deferring lighting calculations and separating them from the geometry rasterization, deferred rendering can offer more flexibility and performance in some cases. However it is tough to use with MSAA and/or transparent objects, and can be a memory bandwidth hog. Modern rendering is all about tradeoffs.