Are decent shadows really THAT expensive?

Discussion in 'Console Technology' started by Dr. Meaty, Dec 28, 2008.

  1. Dr. Meaty

    Newcomer

    Joined:
    Jul 24, 2005
    Messages:
    180
    Likes Received:
    1
    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?
     
  2. Nano

    Regular

    Joined:
    Dec 7, 2007
    Messages:
    288
    Likes Received:
    0
    Location:
    London, England
    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.
     
  3. Neb

    Neb Iron "BEAST" Man
    Legend

    Joined:
    Mar 16, 2007
    Messages:
    8,391
    Likes Received:
    3
    Location:
    NGC2264
    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.
     
  4. Dr. Meaty

    Newcomer

    Joined:
    Jul 24, 2005
    Messages:
    180
    Likes Received:
    1
    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.
     
  5. Neb

    Neb Iron "BEAST" Man
    Legend

    Joined:
    Mar 16, 2007
    Messages:
    8,391
    Likes Received:
    3
    Location:
    NGC2264
    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.
     
  6. TheAlSpark

    TheAlSpark Moderator
    Moderator Legend

    Joined:
    Feb 29, 2004
    Messages:
    21,175
    Likes Received:
    6,531
    Location:
    ಠ_ಠ
    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).
     
  7. homerdog

    homerdog donator of the year
    Legend Veteran Subscriber

    Joined:
    Jul 25, 2008
    Messages:
    6,216
    Likes Received:
    1,001
    Location:
    still camping with a mauler
    I feel you, shadows in most games seem to hurt more than they help... Mass Effect :evil:
    So modern (console) hardware is more suited for shadow mapping than volumes?
     
  8. idsn6

    Regular

    Joined:
    Apr 14, 2006
    Messages:
    484
    Likes Received:
    137
    There was a little discussion on this back in this thread.
     
  9. Graham

    Graham Hello :-)
    Moderator Veteran Subscriber

    Joined:
    Sep 10, 2005
    Messages:
    1,479
    Likes Received:
    209
    Location:
    Bend, Oregon
    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)
     
  10. Arwin

    Arwin Now Officially a Top 10 Poster
    Moderator Legend

    Joined:
    May 17, 2006
    Messages:
    17,856
    Likes Received:
    1,402
    Location:
    Maastricht, The Netherlands
  11. homerdog

    homerdog donator of the year
    Legend Veteran Subscriber

    Joined:
    Jul 25, 2008
    Messages:
    6,216
    Likes Received:
    1,001
    Location:
    still camping with a mauler
    Excellent read, thanks.
    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:
     
  12. sebbbi

    Veteran

    Joined:
    Nov 14, 2007
    Messages:
    2,924
    Likes Received:
    5,293
    Location:
    Helsinki, Finland
    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.
     
  13. Fafalada

    Veteran

    Joined:
    Feb 8, 2002
    Messages:
    2,773
    Likes Received:
    49
    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.
     
  14. homerdog

    homerdog donator of the year
    Legend Veteran Subscriber

    Joined:
    Jul 25, 2008
    Messages:
    6,216
    Likes Received:
    1,001
    Location:
    still camping with a mauler
    Like a desert?
     
  15. Nano

    Regular

    Joined:
    Dec 7, 2007
    Messages:
    288
    Likes Received:
    0
    Location:
    London, England
  16. eastmen

    Legend Subscriber

    Joined:
    Mar 17, 2008
    Messages:
    10,052
    Likes Received:
    1,557
    is there a way to make them hardware acclerated ? or is it really just an increase in rops and shader ability ?
     
  17. Dr. Meaty

    Newcomer

    Joined:
    Jul 24, 2005
    Messages:
    180
    Likes Received:
    1
    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.
     
    #17 Dr. Meaty, Jan 1, 2009
    Last edited by a moderator: Jan 1, 2009
  18. Bohdy

    Regular

    Joined:
    Jun 9, 2003
    Messages:
    731
    Likes Received:
    4
    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...
     
  19. fehu

    Veteran Regular

    Joined:
    Nov 15, 2006
    Messages:
    1,589
    Likes Received:
    558
    Location:
    Somewhere over the ocean
    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...
     
  20. Neb

    Neb Iron "BEAST" Man
    Legend

    Joined:
    Mar 16, 2007
    Messages:
    8,391
    Likes Received:
    3
    Location:
    NGC2264
    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".
     
Loading...

Share This Page

  • About Us

    Beyond3D has been around for over a decade and prides itself on being the best place on the web for in-depth, technically-driven discussion and analysis of 3D graphics hardware. If you love pixels and transistors, you've come to the right place!

    Beyond3D is proudly published by GPU Tools Ltd.
Loading...