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 3 of 3

Thread: Shadow Volumes Silhouettes

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2002
    Posts
    24

    Shadow Volumes Silhouettes

    Hi, how to compute the silhouette of a triangle for shadow volumes ?
    I've projected the triangle to the surface(not the way shadow volumes work but whatever, it was just to practise) where the shadow will appear but if the light is closer to the triangle the shape of the shadow stills the same which is wrong. If the light is closer to the triangle, the shadow volume should be bigger than if the light isn't so closer to the triangler. Anyone please ?

    Thanks, bye.

  2. #2
    Member Regular Contributor
    Join Date
    Aug 2000
    Location
    Turin
    Posts
    269

    Re: Shadow Volumes Silhouettes

    Shadow volumes are done by CREATING the shadow volume, not just projecting the occluder silouette.
    By creating the shadow volume means to create a new volume face for every silouette edge, from the light source to infinity (ok, not always).
    This way you "automatically" get a volume shadow changing according to the light/occluder position.
    [rIO^sPINNING kIDS] - rio@nospam.spinningkids.org

    -/- This is a signature virus. Add it to your signature. Help it spreading! -/-

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

    Re: Shadow Volumes Silhouettes

    I don't think you projected the triangle the right way, plus this isn't exactly shadow volumes. You are doing projection calculations, which comes down to ray-plane or ray-polygon intersection tests.

    vector1=vertex1 - lightposition
    vector2=vertex2 - lightposition
    vector3=vertex3 - lightposition

    vector1 2 3 are the direction for your ray and the starting position is vertex1 2 and 3 respectively. Then plug them into the intersection algorithm.
    Doing shadow volumes starts off like this too, but not the same method!

    V-man
    ------------------------------
    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);

Posting Permissions

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