October 30th, 2024

Classic 3D videogame shadow techniques

The article examines the evolution of shadow techniques in 3D video games, detailing methods like blob shadows and shadow mapping, while highlighting their artistic and technical implications in modern gaming.

Read original articleLink Icon
Classic 3D videogame shadow techniques

The article discusses various classic shadow techniques used in 3D video games, highlighting their evolution and implementation. It begins with a philosophical dialogue from the film "Perfect Days," which sets the stage for exploring how shadows are perceived in both reality and gaming. The author explains simple shadow techniques, starting with 2D shadows and progressing to more complex 3D methods like blob shadows, planar shadows, and projected texture drop shadows. Each technique is illustrated with examples from notable games, such as "Super Mario 64" and "Doom 3." The article also covers shadow mapping, which has become the standard approach in modern games, and stencil shadows, which, despite their unique aesthetic, are less commonly used today due to their computational demands. The discussion concludes with a look at how modern games integrate traditional techniques, such as Cascaded Shadow Maps and lightmaps, to enhance visual fidelity while maintaining performance. Overall, the piece provides a comprehensive overview of how shadows have been crafted in video games, reflecting both artistic choices and technical constraints.

- The article explores the philosophical and technical aspects of shadow techniques in 3D video games.

- It details various shadow techniques, including blob shadows, planar shadows, and shadow mapping.

- Examples from classic games illustrate the evolution of shadow rendering methods.

- Stencil shadows are noted for their unique aesthetic but are less common due to performance issues.

- Modern games combine traditional techniques to achieve high-quality visuals while optimizing performance.

Link Icon 23 comments
By @01HNNWZ0MV43FF - 3 months
My favorite shadow fact is that outdoor shadows are blue.

It's not an optical illusion or artistic vibe or anything. The sky is blue, shadows on a clear day are illuminated by bounced light from the sky, therefore shadows are blue.

If you look underneath cars you can see it - A sharp blue shadow where the sky is visible, that fades to true black where the car's body occludes light from the sky.

If you combine this sharp blue sun shadow with a soft and black "AO" sky shadow you can get very pretty shadows for cheap.

By @jsheard - 3 months
I like the variant used in modern Nintendo platformers - they use shadow maps like basically everything else nowadays, but the player characters shadow is rigged to always be cast straight down regardless of where the actual light sources are. That helps the player gauge where they're going to land after a jump like a classic blob shadow, but with the visual fidelity of a proper shadow.

IIRC in dark environments they also rig the shadow to be brighter than the ground to make sure it remains visible.

By @fourteenfour - 3 months
I've always thought Valorant looked like crap because the players don't cast shadows. Just found out the other day that it's because other player model positions aren't sent to the client until the server determines they are visible to reduce cheating. This would cause shadows to appear and disappear as the player model was loaded and unloaded so you would never see a shadow unless you could also see the body of the player.
By @aarongeisler - 3 months
Great post. There are lots of nostalgic game references here. I still remember being blown away by the shadows in the N64 Zelda many years ago.

I expect area lights and soft shadows to become the norm as ray-traced techniques are adopted. If you have the hardware, it's worth checking out Quake 2 RTX to see what the future might look like.

Lastly, I've added your blog to my growing list of graphics resources: https://github.com/aaron9000/c-game-resources

By @TapamN - 3 months
>Possibly the earliest shipping game with stencil shadows is Severance: Blade of Darkness from 2001 whose shadows look great.

Revolte, for the PowerVR PCX1, had stencil shadows in 1996.

https://www.youtube.com/watch?v=7BvtML5dIuI

The PowerVR PCX1 had hardware support for shadow volumes, which were implemented more efficiently than standard stencil shadows. Rather than drawing the scene multiple times, it basically did a depth-only pre-pass (in hardware, to an on-chip depth/stencil buffer) to determine visible pixels and test the shadow volumes to determine what pixels are in shadow, then it preformed texture sampling and shading afterwards, with lighting brightness adjusted by shadow volume results. It would only shade visible pixels, overdraw would not waste bandwidth on unnecessary texture fetches.

The Dreamcast, based on the successor to the PCX1, also had many games with shadow volumes. The Dreamcast's implementation was more flexible, and its volumes could adjust more than lighting, such as what texture is used, UV mapping, or even what blending equation is used for transparent polygons.

I've managed to get soft shadows on the DC (https://imgur.com/a/DyaqzZD at the end), although it's pretty fill rate heavy, since it falls back to a more standard stencil method and redraws the shadow multiple times.

By @MattRix - 3 months
For an example of the state of the art in videogame lighting, check of Epic’s recent UE 5.5 MegaLights demo: https://youtu.be/p9XgF3ijVRQ?si=GcU0kP33iKQh_5Ge
By @otikik - 3 months
Shadows do get "darker" when they overlap and there's more than a single light source.

3 people illuminated by 2 lamps will project 6 shadows. Where the 6 shadows all overlap, that will be "black" (or only picking ambient light). In other places where less shadows overlap, you will get a gradient of illumination.

By @justsomehnguy - 3 months
>> Some early flight simulators draw a top-down flat shadow when on a runway. During my research I expected to see examples where the shadow is also seen when in flight but couldn’t find any.

F-29 RETAL aka F29 Retaliator aka F29

That shadow was another small tidbit what gave this game the enormous feel of speed.

https://imgur.com/a/hOgxr7a

https://www.mobygames.com/game/6233/f29-retaliator/

By @omnibrain - 3 months
For me the most impressive „shadow moment“ happened while playing GTA IV. I ha a quite beefy gaming PC and the real time shadows cast from the beams of the player vehicle were generally great.

The moment that’s still stuck with me happened while stealing a car in a back alley at night. Right as my player character entered the car a police man came around the corner. He „saw“ me stealing the car and pulled his gun right when the headlights of the car turned on and cast a huge shadow of the police man in motion onto a nearby wall.

By @moralestapia - 3 months
Great article, fun to read.

The shadow overlap in MGS is not completely incorrect as there's ambient light, scattering and other similar global illumination phenomena.

>Mirror’s Edge (2008, PC) is basically Lightmaps: The Game.

Lol, true. Impressive game at the time, and even nowadays.

By @msephton - 3 months
One of my favourites are the shadows in PS1 game Power Shovel (aka Power Diggerz) which were interesting as they had to be projected over uneven terrain. I guess planar shadows is the closest technique in the article. https://www.youtube.com/watch?v=j_c4ZgcLTuE
By @chungus - 3 months
Clicked this because it sounded interesting and was surprised to see one of my favorite movies in the introduction!

edit: really nice and nostalgic read, I played almost all of the games mentioned.

By @mordae - 3 months
Thanks, it was an interesting read. Could have been more technical, though.

I am toying with lighting little voxel grid scene these days, targeting RP2040 and a measly 160x120 px screen and it's crazy how computationally and memory expensive this stuff is.

By @nxobject - 3 months
Mirror's Edge is more of a example of lighting technique than shadow technique – key to the aesthetic of the game was lots and lots of baked radiosity; [1] like Quake/Source, but with a LOT more resolution (including normalmapping), much more bounces, area lights, etc. etc. etc. It was released in 2008 and runs on a potato, but real-time GI's only recently been able to match its look.

[1] https://www.slideshare.net/slideshow/henrikgdc09-compat/3128...

By @nuancebydefault - 3 months
So many shadowing techniques! Interesting how using ray tracing inherently makes rendering shadows a non issue.
By @throwawayk7h - 3 months
> Shadows do become darker when they overlap in Metal Gear Solid.

They should indeed get darker when there are multiple significant light sources, as in the Metal Gear Solid screenshot. This is because the addition of another obstruction (i.e. Solid Snake) causes more sources of light to be blocked.

By @samsartor - 3 months
SketchUp uses stencil shadows! Although we have more modern options, it is part of the look.
By @tanepiper - 3 months
A great article but I can't believe they missed Third: The Dark Project from their list.
By @scudsworth - 3 months
very fun read! familiar with a lot of these old school low tech approaches but somehow never came across the mdk/winter gold style of just painting the shadow first and character second with a fixed pov, haha
By @fatih-erikli-cg - 3 months
It is some piece of snow that falling from the opposite angle of the shadow. Nothing has changed in the pictures of our times.
By @utw856e8866e - 3 months
Rkkrwwkgktekgle