Is it just me? Seems like shadow rendering is still very expensive

futurefields

Diamond Member
Jun 2, 2012
6,470
32
91
Modern games have pristine graphics but the one thing that sticks out to me in most games is that shadows still often look pixelated. How long will it be until shadows can match the quality of the textures they are drawn on? There must be some more efficient algorithms out there.

Also what's weird is I pulled up Doom 3 and it's shadows still look better (higher resolution atleast) than a lot of newer games, seems like developers are choosing to sacrifice shadow quality in order to pump up other areas?

But I can't be the only one who gets distracted by shadow acne in otherwise pristine looking games.
 

smackababy

Lifer
Oct 30, 2008
27,024
79
86
Shadows are likely hard because they depend on calculations of where you're rending things and from which light source they are from. It might not be an algorithmic efficiency issue.
 

Borealis7

Platinum Member
Oct 19, 2006
2,901
205
106
i agree, shadows are the first feature i turn down or off completely when performance starting dipping.
i even know some of the mathematics behind shadow rendering and that alone gives me a headache :)
 

Stg-Flame

Diamond Member
Mar 10, 2007
3,668
613
126
The shadows look great when you max the settings. I can only think of a few games where the shadows looked bad even at maxed settings.
 

futurefields

Diamond Member
Jun 2, 2012
6,470
32
91
Are you kidding me? Pretty much every single game it is clear within about 50 feet (give or take depending on the game) of the camera the shadows drop off in quality. In a lot of games, especially open world games, you can clearly see a line in the distance where shadows stop and start rendering based on distance to the camera. In GTA5 even on max settings the circle of "high quality" shadows around the player character is only a few feet, and then they drop off into pixellated lower resolution shadows. Or Far Cry 4 even on the most maximized settings you have shadows clearly popping into view at not that far of a distance https://youtu.be/XAGXN598wWY?t=1m
 

Stg-Flame

Diamond Member
Mar 10, 2007
3,668
613
126
Given your trend of posting, I'll just say this:

If shadows were rendered as far as draw distance, then the amount of people who could run games completely maxed out would drop to below 1%. If you honestly need to see a detailed shadow of a tree 500ft off in the distance - a tree that you'll probably never notice anyways - then you really need to spend less time on the computer.
 

BSim500

Golden Member
Jun 5, 2013
1,480
216
106
I'm no games designer / coder and don't pretend to understand the "under the hood details", but from what I grasp of the basics it boils down to the age-old compromise of quality vs performance. Eg, it's entirely possible to "bake in" shadows, soft shadows, Ambient Occlusion, etc, freeing up a huge amount of "real-time" calculations. A lot of older games did this out of necessity and looked good for the performance, but the problem then is the game-world needs to be relatively static / linear to pull it off.

Eg, say a barrel is standing against a building. If you do shadows, Ambient Occlusion, etc, in real-time, the shadows cast onto the building's wall are there when the barrel is there but are gone if the barrel is moved or destroyed but the game will run slower especially if there are dozens / hundreds of shadow-producing light-sources. But if you "bake stuff in", it'll run much faster but the "barrel shadow" painted on the building's wall via a static shadow-map may remain there even after the barrel has been moved / destroyed. Real-time looks more accurate in dynamic environments but runs much slower (when used on everything) that in order to not grind most PC's to a halt, both lower resolution shadow-maps (which causes "aliasing" on the edges of shadows as seen in Skyrim) plus the "view distance" at which shadow calculations start / stop are reduced to noticeable levels. Pre-baked can use much higher resolution shadow maps and longer view distances with far less performance impact, but they won't be "environmentally responsive".

The problem (and so many other problems) is conflicting demands from gamers who don't even know what the effects of what they're calling for half the time. If you gave gamers what they wanted (100% open-world, every $60 game lasts 200hrs, 100% interactable objects, deformable environments, every in-game light a "real" shadow-casting light, etc), then every game would need 10GHz CPU's and crawl at 5fps even on top-end GPU's. Developers regularly have to "cheat" to keep things real.

Example : Fallout 4:-

SSAO : http://gearnuke.com/wp-content/uploads/2016/01/fallout4-ssao.png
HBAO : http://gearnuke.com/wp-content/uploads/2016/01/fallout4-hboa+.png

Look at the floodlights in the background in the upper-left half of the picture. They are muddy and have fake shadows in HBAO+ because they are probably not "real" individual lights. What the dev does, eg, for the left hand light, is create 75x fake looking lights close together then places a single "invisible" light source coming from the centre of the group. This gives a big boost in performance but messes up things like HBAO as it doesn't "see" each individual bulb as being a light and promptly paints a shadow on it as if it were another light-colored wall. If you swapped that single "group light source" with 75x individual shadow casting lights (one for each bulb then did the same for every single bulb elsewhere), it might fix the accuracy problem but then having hundreds of shadow casting lights and then performing shadow calculations on each one, performance would fall through the floor into single-digit fps even on top-end rigs.

I know what you're saying though with older games. Eg, FEAR 1 is another example of an old game that looks really good in the lighting / shadow dept. Many scenes may lack the "fine detail" of not having AO style shadows on small objects facing away from lights, but the "base" (non post-processed) game often looks pretty good on the "scene as a whole" basis. Even Unreal Gold (2000) does some amazing "stand-out" things with pre-baked static lighting (especially colored) and shadowing that "makes sense" often a lot more than badly over-enhanced post-processed AO which half the time just "colorizes" a dark "shadow halo" in corners / edges even when they're directly facing light sources. Likewise Deux Ex 1 (same UE1 engine) has simple circles for shadows underneath characters, breakable crates don't have shadows, etc, (no "real" dynamic shadows due to primitive engine), and yet the pre-baked static stuff you see on walls created by fixed objects can still be viewed from the other side of the map with no pop-in or distance cut-off.

But open-world games preclude this due to sheer impracticality of going through every square metre of environment and tweaking it (as you can do in an FPS divided into "levels" or scenes in a point & click adventure). Eg, the best outdoor "pre-baking" you can do in Skyrim if you turned dynamic shadows off is draw a "simple circle" shadow underneath each tree. You can't draw a realistic static tree outline shadow on the ground because the sun moves across the sky and there's a day/night cycle. So everything is dynamic, and as a result, shadow view distances and resolutions have to be drastically shortened to "keep it real". It's annoying to see a horizontal "line" where shadows just appear, but it does make sense from an efficiency point of view.

Even after all this time there is no real "magic bullet" for efficient real-time dynamic shadows and quite honestly, outdoor shadows will always look cr*p in open-world games one way or another (short view distance or fuzzy edges) vs linear games with relatively static light sources / times of day that can get away with using a larger amount of high-resolution "pre-baking".
 
Last edited:

PrincessFrosty

Platinum Member
Feb 13, 2008
2,300
68
91
www.frostyhacks.blogspot.com
Modern games have pristine graphics but the one thing that sticks out to me in most games is that shadows still often look pixelated. How long will it be until shadows can match the quality of the textures they are drawn on? There must be some more efficient algorithms out there.

Also what's weird is I pulled up Doom 3 and it's shadows still look better (higher resolution atleast) than a lot of newer games, seems like developers are choosing to sacrifice shadow quality in order to pump up other areas?

But I can't be the only one who gets distracted by shadow acne in otherwise pristine looking games.

It's a hard problem to solve in real time, I don't think it's because of inefficiency. The more lights you add to a scene the more of the scene you have to render, you have to render the scene again for each light that can cast shadows with respect to all the geometry it can light and shadow.

Shadow maps were used prior to Doom 3, this is where you render some geometry from the perspective of where the light source is, and then store a texture map of the resulting profile of the object and then shadow that area. Because this is stored as essentially a texture it's constrained by amount of memory and memory bandwidth and this gives you the pixelated shadows you mention.

In Doom 3 Carmack introduced real time dynamic stencil shadows which draw actual volumes of shadows into the world which are themselves geometric-like, this is initially expensive however you can render the shadow volume pixel perfect to any scale which means a high resolution scene can have extremely crisp shadow edges. However even this is a naive implementation of shadowing, often with self shadowing issues. Because geometric-like lighting is so expensive it means you're on a budget of the number of dynamic lights you can use and the amount of geometry you can have in the scene, since every object also has this invisible stencil of its profile projected by every single light source. You get this quickly growing complexity.

Since then we've improved lighting with Ambient occlusion and other methods, there's still a way to go, shadows tend to have fuzzy edges because light sources aren't typically perfect points so soft shadows was invented. And typically shadows become softer and more diffuse the further the further the shadows projection is away from an object. So a shadow of a tree on the ground has a sharp trunk but as you get towards to the top of the trees shadow it's a lot more diffuse. There's also been solutions for self shadowing and various types of ambient occlusion each with their own benefits.

If you want really quite good shadows then the Division is a good case study, here Nvidia supply us with HFTS which is a hard showing technique that blends into soft shadows. It's expensive as hell but solves most of the problems above in one shadow technique.

http://www.geforce.co.uk/whats-new/...de#tom-clancys-the-division-shadow-resolution

Check out the lighting sections and the interactive slides to see the differences in techniques.