The increasing photorealism of computer graphics are easy to take for granted, and most people that don’t ever have to model and render a scene do exactly that. Keith O’Conor of Romero games (and formerly a 3D technical lead on titles within the Far Cry and Watch_Dogs series made at Ubisoft Montreal) recently wrote up a ‘GPU Performance for Game Artists 101’ reference text – and it remarkably accessible. He covers the GPU pipeline from input assembly, to vertex shading, to rasterization, to pixel shading, through render target output and breaks down how the GPU is processing geometry at each step, which gives you a rudimentary understanding of how a scene comes together in real-time. Here he is on some of the pitfalls of determining render order:
Ideally every scene would be rendered front-to-back (ie. objects closest to the camera first), so that only the foreground pixels get shaded and the rest get killed by the early depth test, eliminating overdraw entirely. But that’s not always possible because you can’t reorder the triangles inside a draw call during rendering. Complex meshes can occlude themselves multiple times, or mesh merging can result in overlapping objects being rendered in the “wrong” order causing overdraw. There’s no easy answer for avoiding these cases, and in the latter case it’s just another thing to take into consideration when deciding whether or not to merge meshes.
O’Conor also summarizes GPU/CPU communication, how VSync works, and introduces streamlining techniques like texture atlases; his discussion of finding bottlenecks and perils of rendering vegetation is a bit more inside baseball, but fascinating nonetheless. This resource is thorough enough for folks looking to pick up a general understanding of how a graphics pipeline works and those looking to dig deeper should note the list of references he ends with.