Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 6 123 ... LastLast
Results 1 to 10 of 55

Thread: Dynamic soft shadows

  1. #1
    Advanced Member Frequent Contributor
    Join Date
    Apr 2000
    Posts
    748

    Dynamic soft shadows

    A few days ago, i had an idea to display per-pixel soft shadows in real-time. I spent a few hours to code it, and here is a first result:

    http://www.3ddev.9f.com/smoothShadow1.jpg

    Granted, the scene is _extremely_ simple but this implementation, which works as an extension to the shadow volumes algorithm, is only fill-rate limited. In addition, the fill-rate overhead for the soft shadows is independant of the geometry complexity, which means it _should_ still run fast on pretty complex scenes.

    You'll also notice a few interesting effects; for example, the higher the distance to the light, the softer the shadow becomes; it's still pretty sharp near the light, as in reality.

    The technic doesn't require any fancy stuff except simple pixel shaders. I've had it working on a Radeon 8500, and it could be implemented on a GF3/GF4. Possibly on a GF1/GF2 with the help of combiners, by accepting a lower quality and speed.

    Now i'm gonna implement a more complex scene to see if there is no artifact or unaware problems with it.. i'm pretty sure speed will be ok, but you never know.. i'll try to post a demo in a few days (maybe with some code) if i see it's usable.

    Y.

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Jun 2001
    Location
    Denmark
    Posts
    748

    Re: Dynamic soft shadows

    Why no explanation of the technique ?

    Is it a combination of shadow volumes with a projected soft shadow texture ( as shown in an ATI demo ) ?

  3. #3
    Senior Member OpenGL Guru Humus's Avatar
    Join Date
    Mar 2000
    Location
    Stockholm, Sweden
    Posts
    2,444

    Re: Dynamic soft shadows

    Looks great
    Looking forward to see a deeper description of the technique.

  4. #4
    Super Moderator Regular Contributor
    Join Date
    Jul 2001
    Posts
    425

    Re: Dynamic soft shadows

    Do you do it as I do in my engine. I add a number of shadow volumes and blend them. Each volume has a higher value of the stencil buffer and therefor you can add very fast soft blended quads over the entire screen using different stencil layers. Shadow further away gets their edger far away from each other wich gives a soft shadow far away and near the edges are almost the same wich gives sharp edges...
    http://www.tooltech-software.com/images/umbra.jpg perhaps not a good picture but anyway..

  5. #5
    Advanced Member Frequent Contributor
    Join Date
    Apr 2000
    Posts
    748

    Re: Dynamic soft shadows

    No explanation because i want to make sure it works in a "real" scene before starting to explain it.. 500 tris on screen is not very impressive, i'm sure you'll agree.

    Which ATI demo are you talking about ? It has nothing to do with softened shadow maps, if that's what you mean..

    Y.

  6. #6
    Advanced Member Frequent Contributor
    Join Date
    Apr 2000
    Posts
    748

    Re: Dynamic soft shadows

    ToolTech: i don't think we do it the same way. I generate the shadow volume only once (which is why i said it's not much dependant of the scene complexity), but i then do some image-based operations with some per-vertex parameters to control the sharpness (hint! hint!).

    Y.

  7. #7
    Advanced Member Frequent Contributor
    Join Date
    Jun 2001
    Location
    Denmark
    Posts
    748

    Re: Dynamic soft shadows

    This is what I was thinking off,
    http://www.ati.com/developer/sdk/Rad...oftShadow.html

    combined with shadow volumes for self shadowing.

    Does your method allow for soft self-shadowing ?

  8. #8
    Advanced Member Frequent Contributor
    Join Date
    Jun 2001
    Location
    Denmark
    Posts
    748

    Re: Dynamic soft shadows

    but i then do some image-based operations with some per-vertex parameters to control the sharpness (hint! hint!).
    Ok, so what about NVIDIA's soft shadow volume demo ( in their Cg browser ) ? Is that related ?

  9. #9
    Super Moderator Regular Contributor
    Join Date
    Jul 2001
    Posts
    425

    Re: Dynamic soft shadows

    I use the same volume. And then I use the vertex weight method to add a skew matrix for the points at the far side. This way I can interpolate between the near sharp volume side and the far volume side using vertex wights 0-1.

  10. #10
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    The Round Table at Camelot
    Posts
    1,537

    Re: Dynamic soft shadows

    but i then do some image-based operations with some per-vertex parameters to control the sharpness (hint! hint!).
    Hmmmm. That is sounding kind of like a theory i have been working on to make stencil shadow volumes soft, with it being the softest at the 'top' of the shadow and sharper at the 'bottom' of the shadow. Just like in that screen. It would be kinda cool if we have both came up with the same technique. Of course, my theory needs some more work, it's not quite at the same point as your method there...yet.

    -SirKnight
    -SirKnight

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •