Summed-Area Variance Shadow Maps (Demo)

Discussion in 'Architecture and Products' started by Andrew Lauritzen, Jan 31, 2007.

  1. zed

    zed
    Legend

    Joined:
    Dec 16, 2005
    Messages:
    6,415
    Likes Received:
    2,139
    true, i was looking at the blurred paths
    thats insane
    i favour detailed shadows though, with varience shadows since theyre so expensive to make, i expect u only can do it with a single light ie 99% of the time its the sun, if u look at suns shadows' they are very sharp (no prenumbra), thus detailed shadows are more fitting with reality, also i believe detailed shadows look ascetically better, (simplified example) a person in a room normally doesnt really have a shadow (ie due to the reflected light its so faint) but sticking in one gives the player the person is standing on the ground + not floating in space.
    cheers for the mention of the deep shadwmaps (ive never seen them before) they look very nice (but very very expensive)
     
  2. Andrew Lauritzen

    Andrew Lauritzen Moderator
    Moderator Veteran

    Joined:
    May 21, 2004
    Messages:
    2,632
    Likes Received:
    1,251
    Location:
    British Columbia, Canada
    Regarding performance of the shader, I'll have to look into that in more detail. I don't know where it's bottlenecked currently - I can't run NVPerfHUD here (no instrumented x64 driver for G80), but maybe PIX could tell me something.

    Certainly I want detailed shadows too - don't get me wrong - but not at the cost of having them extremely aliased and ugly. Erring on the side of potentially blurrier but no swimming or aliasing is normally the best for standard textures, and almost always the best for shadows.

    Yeah they're stupidly expensive even in the offline world and have several undesirable characteristics like potentially unbounded storage per-pixel. However eventually the hardware will be able to handle something this complex at interactive rates. Then again there are probably more efficient ways to get "good enough" results for most scenes (ex. VSM or PCF).
     
  3. Reverend

    Banned

    Joined:
    Jan 31, 2002
    Messages:
    3,266
    Likes Received:
    24
    First of all, you have my admiration and commendations for your continued study/interest in VSM.

    Currently and as has been the case for as long as I remember, the last sentence above really is important in the scheme of it all (rate of progress, economies of scale... both from the HW and SW side). I have become quite enthusiastic about VSM since last year's GDC (i.e. your presentation) however and if time permits I'll write you an email about my thoughts on things that haven't been discussed here so far.
     
  4. Reverend

    Banned

    Joined:
    Jan 31, 2002
    Messages:
    3,266
    Likes Received:
    24
    Apparently, the results are deemed acceptable on the current platforms, but especially so on one particular platform. <shrug>
     
  5. Andrew Lauritzen

    Andrew Lauritzen Moderator
    Moderator Veteran

    Joined:
    May 21, 2004
    Messages:
    2,632
    Likes Received:
    1,251
    Location:
    British Columbia, Canada
    Please do! I love to hear feedback and suggestions, which is why I enjoy posting the work publicly.

    In other new, my chapter was accepted to GPU Gems 3! :D Look forward to a thorough write-up there, and feel free to give me suggestions in the mean time!
     
    Rys likes this.
  6. trinibwoy

    trinibwoy Meh
    Legend

    Joined:
    Mar 17, 2004
    Messages:
    12,062
    Likes Received:
    3,119
    Location:
    New York
  7. Nite_Hawk

    Veteran

    Joined:
    Feb 11, 2002
    Messages:
    1,202
    Likes Received:
    35
    Location:
    Minneapolis, MN
    Congratulations! You definitely deserve it. :D Keep up the good work!
     
  8. Cal

    Cal
    Newcomer

    Joined:
    Oct 7, 2006
    Messages:
    58
    Likes Received:
    12
    Location:
    Shanghai
    Nice work!

    About how to eliminate the light bleeding artifact, I think a simple alpha blending may help:
    many games do not render meshes with shadowmap directly. Instead they render the shadowmap into a screen sized, temporary buffer and then put it into the framebuffer at post-processing time. The reason for doing this is that you can do some manipulations on shadows.
    Now, when rendering the temporary buffer, set alpha blending operator to multiply or minus, then you wont get bright edges in dark shadow area. Just a quick thought, haven't tested myself.

    EDIT: The alpha blending won't work. The shadow edge is not the object edge.
     
    #48 Cal, Feb 11, 2007
    Last edited by a moderator: Feb 12, 2007
  9. nAo

    nAo Nutella Nutellae
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    4,400
    Likes Received:
    440
    Location:
    San Francisco
    Only games with kind of very simple lighting equations do that..and yes, it's an hack..just not a very good one imho. The only non-hacky way to eliminate light bleeding is to reconstruct depth values distribution around a texel in a more accurate way.
     
  10. Andrew Lauritzen

    Andrew Lauritzen Moderator
    Moderator Veteran

    Joined:
    May 21, 2004
    Messages:
    2,632
    Likes Received:
    1,251
    Location:
    British Columbia, Canada
    Eww, screen space blur ;)

    Yup, this is fundamental to note: any algorithm that takes less than N samples from a filter region of size N cannot get the same results as PCF. This is not to imply that PCF is some kind of gold standard, but it's worth noting that since the occluder distribution is actually a step function, some sort of adaptive algorithm that falls back on brute force in complex regions is the only way to get "correct" results. It's interesting to note that SAVSMs have a very obvious and fairly efficient adaptive sampling algorithm. IMHO it isn't worth it for games yet when the simple light bleeding reduction function works quite well, but it'd certainly be worth a look in the offline world.
     
  11. jbizzler

    Newcomer

    Joined:
    Mar 24, 2007
    Messages:
    29
    Likes Received:
    1
    Location:
    Warrenville, IL, USA
    I'm too lazy to look throught this entire thread. I'm just goign to come out and ask it; what kind of blur do you use? I implemented a gaussian blur, but it still didn't look nearly as this demo.
     
  12. jbizzler

    Newcomer

    Joined:
    Mar 24, 2007
    Messages:
    29
    Likes Received:
    1
    Location:
    Warrenville, IL, USA
    Oh, nevermind. This is a "Summed-Area Variance Shadow Map". Is the source available anywhere? This si still so far beyond my implementation in quality.
     
  13. jbizzler

    Newcomer

    Joined:
    Mar 24, 2007
    Messages:
    29
    Likes Received:
    1
    Location:
    Warrenville, IL, USA
    I wish you could edit posts here. No source because GPU Gems 3; got it. What's the timeframe on that being published anyway?
     
  14. Geo

    Geo Mostly Harmless
    Legend

    Joined:
    Apr 22, 2002
    Messages:
    9,116
    Likes Received:
    215
    Location:
    Uffda-land
    In another week or so you'll be able to do so. It's a usergroup thing. When your title says "Junior Member" instead of "Registered" you'll have edits.
     
  15. Andrew Lauritzen

    Andrew Lauritzen Moderator
    Moderator Veteran

    Joined:
    May 21, 2004
    Messages:
    2,632
    Likes Received:
    1,251
    Location:
    British Columbia, Canada
    I just use a box filter here... nothing fancy. Gaussian is probably overkill. Do note however that the same (or better) quality as this demo can be obtained just by normal VSM blurring. The only thing that SAT's give is per-pixel filter width control, which isn't actually used for anything special in the current demo :)

    The next demo will be in D3D10, including "normal" blurred and hardware filtered VSMs as well (i.e. constant filter width), shadow MSAA, better performance for some of the techniques, and some other goodies.

    Gems3 is slated to be released at SIGGRAPH this year (August).
     
  16. jbizzler

    Newcomer

    Joined:
    Mar 24, 2007
    Messages:
    29
    Likes Received:
    1
    Location:
    Warrenville, IL, USA
    Isn't a box blur just a 3x3 PCF? And what's a normal VSM blur?
     
    Simon F likes this.
  17. Andrew Lauritzen

    Andrew Lauritzen Moderator
    Moderator Veteran

    Joined:
    May 21, 2004
    Messages:
    2,632
    Likes Received:
    1,251
    Location:
    British Columbia, Canada
    No, I mean a box filter function - i.e. equally weighted samples over some neighborhood (2x2, 3x3, or much larger - even 50x50 is quite fast with VSMs).

    By "normal" blurred VSM I simply mean VSMs using hardware mipmapping, trilinear and anisotropic filtering, but pre-blurring the shadow map to effectively clamp the minimum filter width. This is contrary to summed-area variance shadow maps in which all filter (and clamping) is done in the shader itself, not using hardware filtering at all.
     
  18. jbizzler

    Newcomer

    Joined:
    Mar 24, 2007
    Messages:
    29
    Likes Received:
    1
    Location:
    Warrenville, IL, USA
    Could you send me an email when you either release the source of this or release the D3D10 demo? My address is the MSN one in my profile.

    Hardware filtering isn't helping much. It looks like how this demo does with Hardware VSM, which is not better looking than the summed-area one.
     
  19. Andrew Lauritzen

    Andrew Lauritzen Moderator
    Moderator Veteran

    Joined:
    May 21, 2004
    Messages:
    2,632
    Likes Received:
    1,251
    Location:
    British Columbia, Canada
    Here's the sequence:

    1) Render depth/depth^2
    2) Blur using a separable NxN filter to soften edges
    3) Generate mipmaps
    4) Bind the variance shadow map, and enable trilinear and anisotropic filtering

    That will produce comparable results to this demo, where the "softness" slider varies "N". I have exactly this implementation in the D3D10 version - and I can toggle back and forth between it and SAVSM - so I know that it works :) It's also generally much faster than SAVSM, even when N is fairly large (~50). It will eventually cross over, but for constant filter widths and hardware that supports fp32 filtering, summed-area tables are just overkill.
     
  20. jbizzler

    Newcomer

    Joined:
    Mar 24, 2007
    Messages:
    29
    Likes Received:
    1
    Location:
    Warrenville, IL, USA
    Oh, I wasn't combining those correctly. I was trying one at a time, then two, and even then they were in the wrong order. Sweet.
     
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...