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 3 of 6 FirstFirst 12345 ... LastLast
Results 21 to 30 of 55

Thread: Dynamic soft shadows

  1. #21
    Member Regular Contributor
    Join Date
    Feb 2002
    Location
    Hamburg, Germany
    Posts
    415

    Re: Dynamic soft shadows

    i think this method is similar to the "depth of field" demo form the NVidia SDK.
    The shadow is drawn once using stencil volumes into a texture which uses automatic mipmap generation. Then two different LOD levels of this textures are blended together... according to the distance of the pixel to the lightsource (ie. written into the alpha part of the framebuffer)

    is this correct ?

    if yes, how do you plan to avoid this "melting" problems ? this was the problem why i stopped my researches on this method...

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

    Re: Dynamic soft shadows

    Here is a demo of my technique...
    www.tooltech-software.com

    Ok. Its a bit slow but some day I will get my algo running faster ;-)

    /Anders

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

    Re: Dynamic soft shadows

    Adrian is the closest to the method so far Although i'm not using automatic mipmap generation.

    To avoid the "melting" problems, my idea is to have the sharpness of the shadow based on the distance to the occluder, then fixed by a factor based on the distance to the viewer. This doesn't remove the melting problem, but greatly helps to reduce it.

    Still working on the demo with a complex scene. I hope to get it finished for the next week end.. be patient

    PS.: ToolTech, trying your demo now..

    PPS.: Ok, tried your demo. I don't think it works as expected on Radeons. It looks like a standard shadow volume (shadows still look sharp) which is just a bit darkened compared to lit areas. A color comparison gave me an average value of gray 176 for lit areas and 173 for darkened areas. In addition, overlapping shadows are darker than non-overlapping shadows (value of 170). I'll try it on a GF4 when i'll have some time. Performance was ok. How many tris are there in your scene ?

    Y.


    [This message has been edited by Ysaneya (edited 09-05-2002).]

  4. #24
    Intern Contributor
    Join Date
    Mar 2002
    Posts
    65

    Re: Dynamic soft shadows

    Nakoruru,
    I goofed up
    I was thinking if I can get the alpha values in the shadow region then i could transform the alpha.. but now i guess it isnt easy to get that in the first place and still I think the min or max of alpha has to be found out.

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

    Re: Dynamic soft shadows

    The HW must support vertex weights extension. Otherwize it will fallback on a plain shadow volume implementation.

  6. #26
    Member Regular Contributor
    Join Date
    Jun 2002
    Location
    Jonesboro
    Posts
    258

    Re: Dynamic soft shadows

    tarantula,

    I figured that is what you where trying to do. Ysaneya, how do you calculate the distance between the shadowed surface and the occluder's silouette?

    One idea off the top of my head is to project a depth map (like in shadow mapping) into the scene and calculate the difference between the occluder depth (from the shadow map) and occludee depth from the light (perhaps from a 1d texture) and store it in the alpha.

    The the difference between the occluder and the occludee depth from the light, not the absolute distance from the light that is needed to calculate how blurry a shadow should be.

    The bigger the difference, the bigger the light appears relative to the occluder, the blurrier the shadow should be.

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

    Re: Dynamic soft shadows

    Actually... i don't. It was not a typo, i use the distance to the light for now, not to the occluder. But i'm working on it.. i'm sure there's an answer. I've also been playing with the idea to store it in the alpha buffer, but haven't found a good solution.. yet. I'm not sure the depth map projection idea will work.. if you want point lights, that is.

    Y.

  8. #28
    Senior Member OpenGL Pro
    Join Date
    Feb 2001
    Location
    Switzerland
    Posts
    1,840

    Re: Dynamic soft shadows

    Originally posted by Nakoruru:
    tarantula,

    I figured that is what you where trying to do. Ysaneya, how do you calculate the distance between the shadowed surface and the occluder's silouette?

    One idea off the top of my head is to project a depth map (like in shadow mapping) into the scene and calculate the difference between the occluder depth (from the shadow map) and occludee depth from the light (perhaps from a 1d texture) and store it in the alpha.

    The the difference between the occluder and the occludee depth from the light, not the absolute distance from the light that is needed to calculate how blurry a shadow should be.

    The bigger the difference, the bigger the light appears relative to the occluder, the blurrier the shadow should be.
    actually, you could do the whole shadowing then.. as i know you like shadowmaps, why don't you setup this?
    http://davepermen.net - if i could stay true to my heart, i would feel totally free

  9. #29
    Intern Contributor
    Join Date
    Mar 2002
    Posts
    65

    Re: Dynamic soft shadows

    Are you sure the difference between the occludee and occluder depths from the light decides the blurriness of shadow for any occluder?
    What if the occluder is concave towards the side of the occludee? I feel its the silhouette that determines it.. so the depth of the silhouette edges should be interpolated and the difference should be between this and the occludee depth.

    [This message has been edited by tarantula (edited 09-06-2002).]

  10. #30
    Member Regular Contributor
    Join Date
    May 2001
    Posts
    255

    Re: Dynamic soft shadows

    OK, so with shadowmaps you have a texture containing a depth map from the lights POV.

    When rendering you're comparing the depth (in light space?) of your pixel with the depth in your shadowmap.

    To get soft shadows you can sample your shadowmap more than once and compare the number of shadowed to non-shadowed results, i.e. ALL shadowed = 100%, 3 shadowed = 75%, 50%, 25%, 0%.

    Could we do the first sample at the pixel location and then use the actual difference between two depths to determine how far away we jitter our other samples ? Samples closer to the shadow depth should have further samples jittered more.

    hmmmm...horrible incorrect.

    Oh well, here's some nice soft shadow papers:
    http://www.mpi-sb.mpg.de/~brabec/doc/



    [This message has been edited by pocketmoon (edited 09-06-2002).]

Posting Permissions

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