Skip to main content

Ever wondered how a 3D game is rendered? Here’s the scoop

software engineer deus ex rendering deusexheader
Image used with permission by copyright holder
Ever stopped at a beautiful scene in a video game and wonder how it works underneath? Adrian Courrèges, a software engineer living in Tokyo, took the time to reverse-engineer the 2011 game Deus Ex: Human Revolution to find out exactly what happens to each and every frame to turn it from code into a video game world.

The first step is just to build the physical objects of the room, creating a normal map and depth map. The normal map is just a physical layout of the space – the engine traces larger objects first, then smaller and smaller until everything is represented.

The depth map is the room as seen from the point of view of the player, with objects that are closer appearing darker, and getting lighter as they get further away.

Then the rendering engine creates a map of the shadows in the room, one for each light. To keep the rendering time low for this step, only the largest objects in the room cast a shadow as seen from a major light source, and only the largest lights are used. These shadow maps are combined with the depth map, and different areas are assigned values based on how lit they are.

Using ambient occlusion, the rendering engine gives definition to the edges of objects in the room. This gives the surfaces and objects that weren’t counted by the major light sources soft shadowing, and will be used later to refine the textures.

Any smaller point-lights in the scene are now computed as well. Not a lot of calculations are done with those numbers yet, but their brightness and color information are noted for every pixel.

Now it’s time to actually start creating the image the player sees. The final color of every pixel is determined by using all of the light and shadow values from the steps before, the material and texture of the object itself, and sometimes a small texture with the patterns of the room on it to improve reflection quality.

The next step is to render any flat or transparent objects, as well as volumetric lights, like the halo given off by smaller light sources. These are the small touches the flesh out the video game world, and give it added immersion.

Just like in real life, lights glow, so the rendering engine creates a bloom effect on any light sources strong enough to warrant it.

Next, anti-aliasing is used to smooth the jagged edges on the edge of objects. It takes a bit of graphical processing power to make this happen quickly, but it’s worth the effect if you can support the overhead.

Now any gamma and color correction is done. That’s mostly at the will of the game designer, if they want the shadows of the game to be darker so you can’t see well, or want to brighten things up for a happier scene, this is when that happens.

Finally, the user interface is drawn on the screen. That doesn’t take very long at all, since it’s usually a static, or at least not very dynamic, image.

Courrèges also includes this nice timeline that shows roughly how long it takes for each piece of the process. There’s a lot more technical info in his full write-up on the process, and it’s worth a read if you’re interested in the exact process that happens with each step.

Editors' Recommendations

Brad Bourque
Former Digital Trends Contributor
Brad Bourque is a native Portlander, devout nerd, and craft beer enthusiast. He studied creative writing at Willamette…
How gaming laptops grew up in 2023
Asus ROG Zephyrus M16 playing Cyberpunk 2077.

Raw power. High refresh rates. RGB. These are some of the defining factors of the best gaming laptops, and they have been for years. But for as much portable power as you could buy, most gaming laptops have skipped a critical element of a great gaming experience: the screen.

In years past, you could find a high refresh rate or good image quality, but you generally couldn't have both. In 2023, gaming laptops grew up, providing both the speed and quality gamers have come to expect, and that sets 2024 up to be an exciting year in the world of gaming laptops.
Let's look back

Read more
Staff picks: How Baldur’s Gate 3 beat the odds to become our 2023 Game of the Year
Baldur's Gate 3's Karlach appears on an image that says Game of the Year 2023.

When I first started playing Baldur’s Gate 3, I was immediately hooked by its engrossing (and gross) story, meaty CRPG systems, and the most personable cast of companions I’ve seen in the genre in quite some time. I knew I was about to sink months of my life into the 100-hour adventure. Things didn’t go according to plan.

The nature of my job meant that I had to move on to Armored Core VI: Fires of Rubicon at the height of my obsession. Though I wouldn’t have much time to put in long play sessions, I resolved to pick away at it throughout the year on Steam Deck. It was a critical error on my part, as I’d quickly learn that the enormous RPG is perhaps the worst commute game on the planet. It felt like I could barely accomplish anything in 30 minutes. Long, turn-based battles would often take up an entire train ride and sometimes I’d simply lose any progress I made to an untimely death. I grew frustrated, wondering why I was having so much trouble finding my way back to a game I loved.

Read more
What is a 3D printer, and how much do they cost?
A Monoprice MP10 3D Printer is creating an octahedron in blue plastic.

It's been a while since 3D printers became available and started allowing people to create 3D objects in the real world right from their own home.

If you're interested in getting a rundown of what 3D printers are, how they work, how much they cost, and what you could do with them, you've come to the right place.
What is a 3D printer?
A Monoprice MP10 3D printer creates an octahedron in blue plastic. Monoprice

Read more