Results 1 to 8 of 8

Thread: Fast shadow silhouette generation.

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2001
    Location
    Copenhagen, Denmark
    Posts
    27

    Fast shadow silhouette generation.

    hi guys.

    I've successfully gotten a mock-up stencil shadowing to work, and now I need to find a good algo for generating the shadow silhouettes. I wanted to discuss this with you before implementing it.

    Anyways, my algo looks like this:

    [quote]<pre>
    foreach light {
    foreach nearby object {
    if (we have silhouette info from last frame) {
    Foreach edge in silhouette {
    if it is not an edge anymore, use a flood-fill principle to find the new edge. [*]
    }
    } else {
    Do a brute-force search for the edges [*]
    }
    }
    }

    [*] This involves the following steps:

    make all silhouette edges potential silhoutte candidates
    Each poly adjacent to the edge is either 'inside' or 'outside'
    foreach candidate {
    get face normal to light for faces on each side.
    if (inside poly faces away from light) {
    if (outside poly faces from light) {
    mark edge as silhouette.
    mark all other edges of both polys as candidates.
    } else {
    mark all other edges of inside poly as candidates.
    }
    }
    if (inside poly faces light) {
    if (outside poly faces away from light) {
    candidate is an edge.
    } else {
    all other edges of outside poly are candidates.
    }
    }
    }
    [/CODE]

    the principle is that I maintain the silhouette from last frame and the check if it is still valid. Where it isn't, I do a flood-fill style updating on the faces around to find the new silhouette.

    Do you think this a good method, or is there something that's better?

    Cheer,
    Nicholas

  2. #2
    Senior Member Regular Contributor
    Join Date
    Mar 2001
    Location
    Berlin, Germany
    Posts
    121

    Re: Fast shadow silhouette generation.

    Hi

    I think using previous Frame Information is a good idea. But i am using a special structure for the creation of shadowvolumes. I precreate this structure on load-time.
    This structure only contains edges. that could be a volume edge. For each edge both normals are stored (i do not allow models with edges shared by more then 2 triangles).
    This way the volume generation gets fast cause you ignore edges between triangles, ontop of a cylinder for example.

    But as you already know from your other thread my shadowing algorithm doesn't work yet. Still haven't implemented clipping and the volume generation has errors.

    There i am looking into a technique from an Nvidia paper which uses infinite triangles.

    Lars

  3. #3
    Junior Member Newbie
    Join Date
    Dec 2001
    Location
    Copenhagen, Denmark
    Posts
    27

    Re: Fast shadow silhouette generation.

    I'm thinking:

    How about if we look at the edges instead of the faces, so that instead of looking at the normal for a two faces, we somehow just look at the edge?

    Don't know 'bout the math, though...

  4. #4
    Senior Member Regular Contributor
    Join Date
    Nov 2000
    Location
    israel
    Posts
    246

    Re: Fast shadow silhouette generation.

    i calculate the connectivity for each brush when it is created, i too, delete every edge that has the same normal on two sides, but actually it should be every edge that the angel between the two normals is <180 degrees. ant way, after that i create a long edge list for each light, composed by the egde lists of each brush inside the light, then i generate the volume, and update it when something moves. i should work it out, but i think it will work. i need to find a way of how to update only the volumes neccessery, because the volumes are stored in each light, not each brush. maybe i should change it. but i dont think.
    -ofer-

  5. #5
    Senior Member Regular Contributor
    Join Date
    Nov 2000
    Location
    israel
    Posts
    246

    Re: Fast shadow silhouette generation.

    actually, i have this idea of how to minimize the number of volumes generated, using a bsp. but i doubt i will have time to implement it, but ill try.
    do you another way of determining if the eye is inside the volumes or not?
    -ofer-

  6. #6
    Junior Member Newbie
    Join Date
    Dec 2001
    Location
    Copenhagen, Denmark
    Posts
    27

    Re: Fast shadow silhouette generation.

    Originally posted by okapota:
    actually, i have this idea of how to minimize the number of volumes generated, using a bsp. but i doubt i will have time to implement it, but ill try.
    do you another way of determining if the eye is inside the volumes or not?
    Quick rejection:

    If the light (including range) is outside view frustum, there i no shadow (there might ave been, but the light is cancelled out).

    Detailed: get the bounding sphere of the object and project it away from the light. If another (visible) objects BS intersects it, there probably is a shadow.

  7. #7
    Member Newbie
    Join Date
    Oct 2001
    Location
    Orange County, Ca
    Posts
    41

    Re: Fast shadow silhouette generation.

    You guys might be interested in this paper.
    http://people.deas.harvard.edu/~pvs/research/silclip/

    They have a method of finding the silhouette edges with minimal testing using a heirarchical tree.

    KC

  8. #8
    Junior Member Newbie
    Join Date
    Dec 2001
    Location
    Copenhagen, Denmark
    Posts
    27

    Re: Fast shadow silhouette generation.

    Wov! Thanks - I'm downloading as I write this.

    Guess theese papers pretty much have stopped any engine development on my part as I try to grasp their contents

    cheers,
    Nich

Similar Threads

  1. Shadow Map Generation
    By moonwalkercs in forum OpenGL: GLSL
    Replies: 1
    Last Post: 07-03-2006, 08:34 PM
  2. Fast mipmap generation
    By Jan Z in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 04-11-2006, 04:04 PM
  3. Shadow Volumes and Silhouette
    By unreal in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 09-01-2004, 04:02 AM
  4. Shadow volume generation
    By mikeman in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 02-17-2004, 08:14 AM
  5. Fast silhouette detection for shadow volumes
    By LaBasX2 in forum OpenGL: Advanced Coding
    Replies: 16
    Last Post: 06-08-2002, 12:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean