Are decent shadows really THAT expensive?

Dr. Meaty

Newcomer
Sorry, I'm not nearly as tech-minded as most of the people who post on this forum. Anyway, entering this generation of consoles from the last one, I was really hoping to see the end of those low-res ugly shadows that basically do nothing but break the immersion and make things look worse. I got Dead Space for Christmas. Obviously, lighting and shadows play a pretty big role in a game like this, and the crappy shadows are really turning me off.
Sorry if it's a dumb question, but would stencil shadows have been an option in Dead Space? I remember Xbox 1 games like Thief: Deadly Shadows and Doom 3 using stencil shadows that looked MUCH better, at least to my eye.
So anyway, are decent shadows really THAT expensive, or are devs just placing them lower on the priority list?
 
Good question.

I've only played Dead Space very briefly so I can't comment too much on that. Doom 3 had very sharp, defined shadowing which was impressive for the time. Now there are calls for shadows that are not only cast on everything, but have more real world properties such as a soft appearance, shadows that account for the attenuation of light and indirect illumination. Interestingly, I think sometimes effects used in the previous generation can and have looked better than newer games, despite using older techniques. Of course this varies a lot from game to game, and as the generation goes on newer techniques become not only more sophisticated but more refined.

I think it would be fair to say, shadowing is one of the biggest problems in real-time 3d graphics. Convincing shadows can indeed be computationally expensive, and it really wouldn't take much to make even the fastest systems grind to a halt. Decent or even really good shadows aren't necessarily too expensive, there are some excellent examples out there, but it really does take a lot of consideration to resources and implementation of several features in the graphics engine.
 
Yes, upping the shadowmap resolution and adding shadow enhancing effects like soft edges and jittering takes away perfomance. Shadowmap resolution has a huge impact on perfomance. Going from 512x512 to 1024x1024 could cut your framerate in half.
 
I guess they are, then. I don't really mean to single out Dead Space, it's pretty much every 360 game I've played. Condemned 1 and 2 both used stencil shadows, but neither of those actually used HDR if I'm not mistaken? Oblivion uses HDR, and has nice shadows for the few objects that actually cast them, but are there any games that use HDR and stencil shadows, or is that just totally nonsensical?
If this thread is nonsensical, sorry, and please put it out of it's misery.
 
Almsot all if not all console games have this what looks like 256x256 and 512x512 shadowmaps. Quite some PC games to using 512x512 shadowmaps or even lower. Atleast on PC you can often tweak it beyond to suit the HW. But some use edge blur others jittering or both to hide as much as possible (jaggies).

I think stencils shadows are avoided becosue of high requirements and increased geometry amount and they dont look as 'realistic'?

Good thread.
 
Condemned 1 and 2 both used stencil shadows, but neither of those actually used HDR if I'm not mistaken? ...

Based on this interview (http://xbox360.ign.com/articles/794/794101p1.html), it would seem that Condemned 2 does use HDR - perhaps one of the FP10 formats for 360. The F.E.A.R. sequel appears to be using both HDR and stencil shadow volumes.

Both can be considered mutually exclusive features as the implementation of one does not preclude the use of the other except where there are performance caveats or other considerations.

Shadow volumes incur higher geometry load/vertex processing and fillrate. Depending on the implementation and needs of the scene, there are trade-offs between implementing it through vertex shaders or CPU. As the polygon counts or the number of shadow-casting lights increase, the benefits of the vertex shader implementation might be nullified (lots of wasted vertices and redundant calculations occurring)... Using the vertex shaders is beneficial in saving on memory bandwidth from geometry transferring that would have occurred with the CPU implementation. A split implementation can be done too.


Shadowmaps/shadowbuffers put the load on filtering abilities (speed, quality, implementation) and available memory. If you consider what happens when framebuffers are upscaled, you can see similarities with what occurs with shadowmaps. Edges become more pronounced with giant steps ('jaggies'), mitigated by the use of complex filters and higher sampling, which will both lead to smoother penumbras as a by-product. Of course, there is the option of rendering higher resolution shadowmaps... Other issues might crop up with overlapping shadowmaps, objects too close to one another etc. that will hit the performance even harder when trying to fix them... The Z/depth-performance of xenos helps. RSX has specific hardware for percentage closer filtering to aid in depth testing (filtering speed/quality). Other performance considerations... setup rate & multi-pass (not as bad with deferred shadowing).
 
I was really hoping to see the end of those low-res ugly shadows that basically do nothing but break the immersion and make things look worse. I got Dead Space for Christmas. Obviously, lighting and shadows play a pretty big role in a game like this, and the crappy shadows are really turning me off.
I feel you, shadows in most games seem to hurt more than they help... Mass Effect :devilish:
The Z/depth-performance of xenos helps. RSX has specific hardware for percentage closer filtering to aid in depth testing (filtering speed/quality). Other performance considerations... setup rate & multi-pass (not as bad with deferred shadowing).
So modern (console) hardware is more suited for shadow mapping than volumes?
 
So modern (console) hardware is more suited for shadow mapping than volumes?

Sortof. At their simplest level, both techniques require good z/stencil performance. It more comes down to what you have to spare. If you are shader / texture / memory limited, then shadow volumes may fit. If you are fill rate limited, then shadow maps may be better for you.
It also depends on other aspects, such as the scale of your world. Close up shadows with far distance detail works better with stencil shadows (as the thread above mentions), otherwise you are looking at techniques like cascaded shadow maps - which aren't cheap. If you have complex geometry, then shadow maps are probably better for you.

As the thread mentions, it's often a good fit to use hybrid techniques. The Darkness uses stencil shadows, except on some main character faces (which used small local shadow maps). The sharp shadows probably didn't look so flash, and their hair would generate far too much geometry. Overall I felt The Darkness had great lighting, and the use stencil shadows meant they felt more 'solid' (subjective, I know :)

Saints row is another example of mixing shadow maps and stencil shadows for differnet lights, or using hybrids (for example, sunlit buildings cast stencil shadows, trees were shadow maps).
The two cases where stencil shadows can win are 'sun' or global lights, with huge depth ranges, or point light sources, which are very tricky to do with shadow maps (eg you could use a cube or dual paraboloid maps).

Another hybrid example is you can use an smallish approximate 'unseen' or throwaway shadow map, which is simply used to do occlusion queries / predicated rendering to cull stencil shadows (preventing casting a shadow when already approximately in shadow). And other similar schemes.

I believe monolith games (condemned, fear), which use stencil shadows, may even render some light sources at lower resolution. So the shadow is low screen-space resolution. However I'm not 100% sure on this.

Stencil shadows can be optimized a lot for static lights (eg doom3 beam-trees), but it's *hard* - however with shaow maps you can simply use two, one for static, one for dynamic geometry (where the static map isn't drawn every frame)
 
There was a little discussion on this back in this thread.
Excellent read, thanks.
Saints row is another example of mixing shadow maps and stencil shadows for differnet lights, or using hybrids (for example, sunlit buildings cast stencil shadows, trees were shadow maps).
The two cases where stencil shadows can win are 'sun' or global lights, with huge depth ranges, or point light sources, which are very tricky to do with shadow maps (eg you could use a cube or dual paraboloid maps).
Funny, I always thought shadow maps were better for global lights. I think it was FarCry that got me thinking this.

Thanks for the response, very informative for an outsider like me but easy to grasp, and the use of examples really helps. Usually when I ask question like that the answers leave me even more confused. :smile:
 
Funny, I always thought shadow maps were better for global lights. I think it was FarCry that got me thinking this.

Stencil shadows are really bad for global lights if the light space depth complexity is large enough. Think about a city scene at sunset for example. All buildings cast long shadow volumes, and the screen gets completely filled with those volumes. The overdraw becomes huge.

Our current game scene is inside a huge warehouse. The warehouse roof and walls have lots of different shaped windows (and holes) that let the sun in. Below the roof and walls (large shadow casters) there are the ceiling structures (lots of pipes and metal bars, etc) and lots of vertical bars keeping the ceiling up (all cause very large shadow volumes). We tried to use our old stencil shadow based lighting system on this scene, but it completely choked on the overdraw.

On a open terrain scene stencil shadows are much more suited approach.
 
sebbbi said:
Stencil shadows are really bad for global lights if the light space depth complexity is large enough. Think about a city scene at sunset for example. All buildings cast long shadow volumes, and the screen gets completely filled with those volumes. The overdraw becomes huge.
If the lightsource isn't moving in realtime, you can precompute the volumes though (for length and overdraw alike), which can yield huge optimizations. On PS2 titles I've worked on this allowed to use global light shadow volumes on city scenes even with low-sun position.
 
is there a way to make them hardware acclerated ? or is it really just an increase in rops and shader ability ?
 
I forgot about the Darkness. That game had terrific lighting, with HDR and stencil shadows, but whether or not a scheme like that could have worked for Dead Space is beyond me.
If nothing else, you'd think that developers would tell certain objects not to cast a shadow at all (like the little doodads on Isaac's back.) It seems to me that a missing shadow here and there would be much less noticeable (and distracting) to the average gamer than a big, blotchy barf shadow all over their character and the environment.
 
Last edited by a moderator:
Dead Space had very good lighting and shadowing imo.

The only shadowing artefact I noticed was the jumpy shadows on Isaac's back, as you mentioned. That and some harder edged shadows around the environment.

Buy yeah, self-shadowing on characters is where shadow maps always seem to fall apart. See Mass Effect, Gears, etc..

I'm thinking it won't really be solved till next gen...
 
In call of duty 5 the shadows are very good: projected realistically and with softshadow effects.
Only self shadowing isn't as good, but definitively good enought.

If a game with such a hight level of detail can deal those shadows I don't see why can't others...
 
In call of duty 5 the shadows are very good: projected realistically and with softshadow effects.
Only self shadowing isn't as good, but definitively good enought.

If a game with such a hight level of detail can deal those shadows I don't see why can't others...

Not sure if it's the same as in COD4 but if or similar then it has horrible LOD. You get better shadow detail upclose but it breaks up ~5-10meters ahead into a jaggy "mess".
 
Back
Top