Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 9 of 9

Thread: Lines "vibrations", Shadow Volume cracks

  1. #1
    Intern Newbie
    Join Date
    Feb 2003
    Posts
    41

    Lines "vibrations", Shadow Volume cracks

    Hi
    Ive got a strange problem with my shadowvolumes:
    Small cracks appear in the volume, depending on my position/where I look at. ( This can not be solved with glPolygonOffset, Ive been playing around with all kinds of values. ).
    If I render the volume in wireframe, I can see that the lines that intersect the surface, on which the shadow is supposed to be visible, move slightly around as I change my position.
    At first I guessed this is caused by the extrusion ( setting w=0 ), but then I just rendered a normal line with 2 vectors that have w=1 and I can still see the line move when I get really close.
    Tough being able to see the lines moving can only be seen at a very low distance to the line, the cracks in the volume are visible across a high distance and it simply looks ugly

    I started thinking about the projection matrix, but since the effect occurs with both, my infinite frustum and gluLookAt, I dont really think that this can be the problem.
    Any ideas?

  2. #2
    Intern Newbie
    Join Date
    Feb 2003
    Posts
    41

    Re: Lines "vibrations", Shadow Volume cracks

    Its gluPerspective, not gluLookAt

  3. #3
    Intern Contributor
    Join Date
    May 2003
    Location
    Cologne / Germany
    Posts
    58

    Re: Lines "vibrations", Shadow Volume cracks

    Try to use the inverse of your object (The backfaces) to extrude the volume. This worked very well for me and i had the same problem before.

    cu
    Tom

  4. #4
    Intern Newbie
    Join Date
    Feb 2003
    Posts
    41

    Re: Lines "vibrations", Shadow Volume cracks

    Hmmmm it looks a little different now, but the basic problem still exists ;(

  5. #5
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,421

    Re: Lines "vibrations", Shadow Volume cracks

    You see cracks like you do for T-junctions?

    Try extruding by a fixed amount instead of infinity.
    ------------------------------
    Sig: http://glhlib.sourceforge.net
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhLoadIdentityf2(matrix);
    glhTranslatef2(matrix, 0.0, 0.0, 5.0);
    glhRotateAboutXf2(matrix, angleInRadians);
    glhScalef2(matrix, 1.0, 1.0, -1.0);
    glhQuickInvertMatrixf2(matrix, inverse_matrix);
    glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
    glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

  6. #6
    Intern Newbie
    Join Date
    Feb 2003
    Posts
    41

    Re: Lines "vibrations", Shadow Volume cracks

    Ive tried extruding by a fixed amount - it doesnt really change alot. Ive heard of the problem with the t junctions. It could be a reason but i think i can exclude them. The problem Iam actually having is that the volume seems to move slightly when I turn... and this is not the whole volume but only single tris of it, independently from the others. And I guess this is not the effect one would expect with the t junctions, because t junctions means missing edges -> incomplete volume...., but nothing about cracks etc... right?

    [This message has been edited by Dtag (edited 12-07-2003).]

  7. #7
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    Re: Lines "vibrations", Shadow Volume cracks

    Originally posted by Dtag:
    The problem Iam actually having is that the volume seems to move slightly when I turn...
    Just a wild guess, but from your description, it makes me think of some kind of lack of precicion in vertices screen position (it could be seen in quake2 md2 in idle animations). Are you using very very small coordinates, in float or int precision ?

  8. #8
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,421

    Re: Lines "vibrations", Shadow Volume cracks

    Originally posted by ZbuffeR:

    Just a wild guess, but from your description, it makes me think of some kind of lack of precicion in vertices screen position (it could be seen in quake2 md2 in idle animations). Are you using very very small coordinates, in float or int precision ?
    It should not matter as long as you dont have cracks, ie. instead of sharing a vertex or giving the multiple vertices the same value, you have multiple vertices with slightly different values.

    To check for them, you can write a "proximity checker".

    something like

    small_value=1.0e-5;
    if(abs(vertex1-vertex2) < small_value)
    {
    vertex1=vertex2;
    }

    T-junctions are another thing and your shadown volumes should not have them.

    I just said T-junction cause you get the well known "crack appearing and dissappearing as you move the camera"
    from them.
    ------------------------------
    Sig: http://glhlib.sourceforge.net
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhLoadIdentityf2(matrix);
    glhTranslatef2(matrix, 0.0, 0.0, 5.0);
    glhRotateAboutXf2(matrix, angleInRadians);
    glhScalef2(matrix, 1.0, 1.0, -1.0);
    glhQuickInvertMatrixf2(matrix, inverse_matrix);
    glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
    glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

  9. #9
    Intern Newbie
    Join Date
    Feb 2003
    Posts
    41

    Re: Lines "vibrations", Shadow Volume cracks

    Hmm after having tested some more, it doesnt seem to have anything to do with the actual creation of the volume. I asked other people to test it and it seems to generally work on ATI... on the GF4 the lines vibrate in a different fashion, where the cracks are not as visible as on my GF3. So I guess it must have to do with the setup or something.
    Btw: the size of the level/coordinates is nothing exceptionally small...

    [This message has been edited by Dtag (edited 12-09-2003).]

Posting Permissions

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