« Tech News
June 13, 2020 18:54

How 3D Game Rendering Works: Lighting and Shadows

The vast majority of visual effects you see in games today depend on the clever use of lighting and shadows -- without them, games would be dull and lifeless.

In this fourth part of our deep look at 3D game rendering, we'll focus on what happens to a 3D world alongside processing vertices and applying textures. It once again involves a lot of math and a sound grasp of the fundamentals of optics.

We'll dive right in to see how this all works. If this is your first time checking out our 3D rendering series, we'd recommend starting at the beginning with our 3D Game Rendering 101 which is a basic guide to how one frame of gaming goodness is made. From there we've been working every aspect of rendering in the articles below...

So far in the series we've covered the key aspects of how shapes in a scene are moved and manipulated, transformed from a 3-dimensional space into a flat grid of pixels, and how textures are applied to those shapes. For many years, this was the bulk of the rendering process, and we can see this by going back to 1993 and firing up id Software's Doom.

The use of light and shadow in this title is very primitive by modern standards: no sources of light are accounted for, as each surface is given an overall, or ambient, color value using the vertices. Any sense of shadows just comes from some clever use of textures and the designer's choice of ambient color.

This wasn't because the programmers weren't up to the task: PC hardware of that era consisted of 66 MHz (that's 0.066 GHz!) CPUs, 40 MB hard drives, and 512 kB graphics cards that had minimal 3D capabilities. Fast forward 23 years, and it's a very different story in the acclaimed reboot.

There's a wealth of technology used to render this frame, boasting cool phrases such as screen space ambient occlusion, pre-pass depth mapping, Bokeh blur filters, tone mapping operators, and so on. The lighting and shadowing of every surface is dynamic: constantly changing with environmental conditions and the player's actions.

Since everything to do with 3D rendering involves math (and a lot of it!), we better get stuck into what's going on behind the scenes of any modern game.

Other News
Perfect Timing