Major shadow rendering techniques

Discussion in 'General 3D Technology' started by Reverend, Apr 23, 2003.

  1. Saem

    Veteran

    Joined:
    Feb 7, 2002
    Messages:
    1,532
    Likes Received:
    6
    OT:

    How replayable is it? How's the bot AI, graphics, sound? How many human players can play together? What's the control scheme like, is there support for a USB kb?
     
  2. Reverend

    Banned

    Joined:
    Jan 31, 2002
    Messages:
    3,266
    Likes Received:
    24
  3. Hellbinder

    Banned

    Joined:
    Feb 8, 2002
    Messages:
    1,444
    Likes Received:
    12
    MODS: I promise not to go any furthe OT than this one reply.

    -Replayability = 10
    -Graphics = 7
    The game plays just like Tribes 2, wtih much beffed up player models and vehicle detail is a lot better to. Is not missing any feature of the big game other than Voice. All game modes are present as well. The maps are a bit simpler of course but still nice. It includes all the best maps from the origional and adds a few more.

    -Bot Ai = 8
    I was immidiately impressed. The bots on your team automatically assume offense, defense and support roles. Within min of starting a match they will have a remote equipment station set up, sensors etc.. they fight pretty damn good to. Its pretty fun to max the bots out to 8 and play a little 4x4 match.

    -Multiplayer = Wooohoo
    The game supports 2 player split screen with a max of 3 bots on each team. But the best part is it supports 16 player internet matches. You can even host your own internet game. There are a few cool configuration settings you can do to. like Auto target lock on and off etc. Once in the game its Tribes 2 all the way. Except everyone is perfectly evenly matched with the exact same performance. Heck they even included the voting support. You can vore to change maps, kick players etc. My absolutly Favorite thing about it is this.. it will let you have 2 players split screen on your PS2 and connect to an online game like that. The two of you sitting there like a little team busting it up online. It is truely a cool feature. I was also impressed to find 32 servers online most with 16 players maxed out, that was a shocker. there are a coupple hundered people playing Tribes on PS2 24/7

    -Control = 7/10
    the controls mapped to the controler are great. It only took me a few min to start raging on people. I cant really go through all the buttons, but trust me they nailed it as far as a controler goes for a FPS. Yes it does support keyboard and mouse.. but i have not been able to test it yet. I am going to buy the Fancy Everquest PS2 keyboard on Friday, so ill have a better idea.

    They even threw in an little single player Campaign. Imagine that.
     
  4. NeARAZ

    Newcomer

    Joined:
    Apr 24, 2003
    Messages:
    97
    Likes Received:
    1
    Location:
    Kaunas, LT
    Tim Sweeney on stencil shadow volumes:
    With some techniques you can have the simplified geometry for the volumes, have self-shadowing and have the volume being generated entirely on the GPU - eg. "reverse extruded shadow volumes" - http://www.gim.ktu.lt/nesnausk/nearaz/texts/revext.html. This isn't cure in all the cases, but in some of them it works.

    That aside, stencil still eats lots of fillrate...
     
  5. Hyp-X

    Hyp-X Irregular
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    1,170
    Likes Received:
    5
    We use perspective shadow map for a single light source (sun).
    It's a top-down view outdoor game (it's RTS after all) so it suits it perfectly.
    It works on all DX8 hardware.
    There are 4 implementations to cover all those cards: PS1.2 (8bit), PS1.4 (12bit), PS2.0 (16bit), nV depth-textures(16/24bit).

    I was quite impressed with the quality of even the 8bit version.
    Surprisingly the nV version has quiet a few problems due to not being flexible enough to adopt the perspective shadow maps correctly.
    This causes the precision of the shadow buffer to drop with the distance from the viewer.
    (I have some ideas for that but don't yet know if it will work well with large surfaces.)

    No public demo yet unfortunately.
    Maybe if you attend E3... :)
     
  6. DeanoC

    DeanoC Trust me, I'm a renderer person!
    Veteran Subscriber

    Joined:
    Feb 6, 2003
    Messages:
    1,469
    Likes Received:
    185
    Location:
    Viking lands
    My 2 pence

    I'm a shadow-map man.

    Stencil shadows are just too slow for the future, even with hardware help (double sided support and fast-rejects). They might be good now (ala Doom3) but next gen there is too much fill-rate and triangles. Low polygons and no alpha-test textures mean lo-res graphics (try doing a jungle with stencil shadows....)

    Perspective shadow maps are very nice, except when shadows cross the near plane (things shadowing from beyond the player). If new research can find robust fast solutions this may be a winner.

    With normal and forward shadow maps the main problems are resolution and precision. Resolution won't be that much of a problem (2Kx2K should be fine in most situations and its fairly easy to use lower res where approaite) but precision might be. For the entire scene FP32 should be good enough (FP64 would certainly solve all the problems). An other advantage is shadow map caching (do we really need 60fps shadows?).
     
  7. Ostsol

    Veteran

    Joined:
    Nov 19, 2002
    Messages:
    1,765
    Likes Received:
    0
    Location:
    Edmonton, Alberta, Canada
    Unfortunately, I'm not too familiar with DirectX programming. I do know that in OpenGL there's a 16 bit, 24 bit, and 32 bit depth texture formats that work quite well for z-buffer shadow maps. The Radeon 9500+ supports the 16 bit and 24 bit formats.
     
  8. SA

    SA
    Newcomer

    Joined:
    Feb 9, 2002
    Messages:
    100
    Likes Received:
    2
    Shadow buffers, with certain improvements, offer the best all around hardware shadowing option in the medium to long term. Currently they require substantially more work (both in the buffer resolution determination and blurring) than they should.

    Spherical harmonic radiance transfer is better suited to surface lighting and self shadowing of non-deformable surfaces. Using SH in conjunction with shadow buffers probably provides the most realistic real-time hardware based lighting.
     
  9. NeARAZ

    Newcomer

    Joined:
    Apr 24, 2003
    Messages:
    97
    Likes Received:
    1
    Location:
    Kaunas, LT
    Now, SH is very cool thing for single non-deformable surfaces, perhaps you even could use them per-vertex on decently tesselated geometry to emulate "radiosity-like lighting for dynamic lights".
    Still, the neighbourhood transfer (one object shadows another) using SH-encoded transfer is a bit of "hack" (although it looks very cool).
     
  10. JohnH

    Regular

    Joined:
    Mar 18, 2002
    Messages:
    586
    Likes Received:
    2
    Location:
    UK
    I'd say shadow buffers were OK if it wasn't for the potentually large memory cost associated with the seperate buffer(s) required per light source, as I assume people want more than a single light these days! Although I guess if you're happy with splodges for shadows this isn't an issue....


    John.
     
  11. DeanoC

    DeanoC Trust me, I'm a renderer person!
    Veteran Subscriber

    Joined:
    Feb 6, 2003
    Messages:
    1,469
    Likes Received:
    185
    Location:
    Viking lands
    AFAIK (One of the ATI OpenGL guys can correct me if I'm wrong), the Radeon R3x0 series doesn't actually support shadow maps natiively. Under OpenGL 1.4 it uses a fragment program when ever you use shadow maps, it the reason why ARB_Fragment_Program and OpenGL 1.4 shadow maps features are mutually exclusive (if you read the fine-print to ARB_Fragment_Program all shadow map calls are disabled, NVIDIA have complained that, that part of the spec was added without consultation).

    Colourless:
    You can use dependent textures to get up 12 bit precision under DX8 and lack of filtering for floats under Dx9 doesn't matter, as linear filtering is completely wrong for shadow-maps. You have to point sample n times and PCF (Percentage closest filtering) so D3DFMT_R32F is fine (but only actually FP24 under R3x0)
     
  12. Hyp-X

    Hyp-X Irregular
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    1,170
    Likes Received:
    5
    Why is that?
    The shadow map contains linear slopes for most parts.
    Linear filtering gets very close to the ideal value.
     
  13. nAo

    nAo Nutella Nutellae
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    4,325
    Likes Received:
    93
    Location:
    San Francisco
    Cause you don't want to depth test a linear filtered value but to
    filter a set of depth tests instead..

    ciao,
    Marco
     
  14. SA

    SA
    Newcomer

    Joined:
    Feb 9, 2002
    Messages:
    100
    Likes Received:
    2
    The potentially large memory cost of shadow buffers can be managed and is associated with dynamically optimizing shadow buffer resolutions based on the relationship of the viewpoint and light source (one of the outstanding problems I mentioned earlier). When this is performed correctly shadow buffers have about the same memory cost as the other solutions, but produces much less of a performance hit for a given amount of realism.

    However, the aliasing artifacts, esp at low shadow buffer resolutions, is probably the most important thing for the hardware to fix in the near term. Trying to perform the anti-aliasing/blurring programmatically loses much of the simplicity and performance that the technique offers.
     
  15. Reverend

    Banned

    Joined:
    Jan 31, 2002
    Messages:
    3,266
    Likes Received:
    24
    Can you elaborate on this? How would I be able to do this?
     
  16. Ostsol

    Veteran

    Joined:
    Nov 19, 2002
    Messages:
    1,765
    Likes Received:
    0
    Location:
    Edmonton, Alberta, Canada
    Ah. . . I've found what you mean:
    Basically, if one is using fragment programs he/she must perform the depth comparison using the fragment program rather than the fixed function pipeline. Without fragment programs enabled, however, ATI supports ARB_shadow just fine. I've used 'em that way.
     
  17. SA

    SA
    Newcomer

    Joined:
    Feb 9, 2002
    Messages:
    100
    Likes Received:
    2
    Concerning the dynamic optimization of shadow buffer resolutions, the details are a bit proprietary, but the basic idea is to adaptively increase/decrease (generally by powers of 2) the resolution of a shadow buffer for a light source based on the size of shadow pixels as seen from the viewpoint.

    A good way to look at the problem is to realize that each pixel on the screen is lit/shadowed, at most, by a just few lights, let's say an average of 4, even though there may be many lights (say dozens or even hundreds) lighting the entire scene. Most shadows in realistic scenes are much softer than the geometry, let's say 1/4 in both x and y meaning the average shadow pixel covers a 4x4=16 pixel screen area (some are sharper and some are softer but say this is the average). This means that there are a total of 4 lights per pixel * 1/16 of a shadow pixel/pixel = 1/4 shadow pixels compared to screen pixels. This means that in this case an entire scene at 1600x1200 with perhaps hundreds of dynamic light sources could be shadowed with just 800x600 worth of dynamically optimized shadow buffer pixels (spread across many shadow buffers and light sources).

    Concerning rendering performance, even though there may be perhaps hundreds of light sources, the total (optimized) shadow rendering resolution of all of them together is only 800x600, which is only 1/4 of the final viewpoint resolution. The problem then becomes one of minimizing the overhead each single shadow rendering, and optimizing the geometry processing.

    Its easy to see that with optimized shadow buffers the real bottleneck in shadow buffer rendering is the geometry processing. Assume for a moment that there are 100 lights in the scene mentioned above. Although there are only 800x600 worth of optimized shadow buffer pixels spread across the 100 lights and so only an extra 800x600 worth of frame buffer processing must be done for the shadows, the scene geometry must all be processed 100 times (once for each light source) in addition to the standard viewpoint pass. To do this effectively requires optimized view frustrum definitions for each light source, efficient scene graphs, very quick geometry culling, processing perhaps at a lower levels of detail (something not easily done with stencil shadows), and front to back processing. Hierarchical z buffers and z occlusion culling can come in handy too.
     
  18. Hyp-X

    Hyp-X Irregular
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    1,170
    Likes Received:
    5
    The linear filtered value comes for (almost) free if you use an R16G16 target.
    Nothing stops you to take a set of those...

    If you use point sampling you actually take a texture sample at an incorrect position. The error of the depth value is dependent on the slope of the surface. That's why there's a need of slope scale bias.

    The problem with bias that it can make you lose the fine details. Linear filtered value can however return the correct depth inside the slope, and while it sounds like a horrible solution at the edges, the depth-error will not be larger than with point sampling.
     
  19. nAo

    nAo Nutella Nutellae
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    4,325
    Likes Received:
    93
    Location:
    San Francisco
    I believe we are speaking about different things.
    I'm not talking about retrieving the 'correct' depth but how decide if a pixel is or isn't affected by a shadow.
    Obviously one wants to retrieve the correth depth valueS for each pixel.

    ciao,
    Marco
     
  20. Hyp-X

    Hyp-X Irregular
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    1,170
    Likes Received:
    5
    Actually a pixel is either in shadow or not, so a single sample is sufficient for determining that.

    You wan't to take multiple samples for antialiasing purposes. Of course with SSAA you wouldn't need to do that shadow edge antialiasing came for "free".

    With MSAA you can emulate having SSAA by taking multiple samples manually from the pixel shader, cause the shader is run only once per pixel.

    (Btw, bilinear filtering the 0/1 values is not a correct way of doing antialiasing.)
     
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...