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

Thread: Yet another problem with shadow volume rendering

  1. #1
    Intern Contributor
    Join Date
    Jun 2004
    Location
    Greece
    Posts
    83

    Yet another problem with shadow volume rendering

    Hello!
    I have a new problem when i draw the shadow volumes. I get some artifacts. Here is a screenshot:

    http://bekengine.periergoi.gr/Screen...olume_prob.JPG

    and here is my source:
    http://rafb.net/paste/results/7JGlti54.html

    any idea what is going on?

    thanks in advance.

  2. #2
    Super Moderator OpenGL Guru dorbie's Avatar
    Join Date
    Jul 2000
    Location
    Bay Area, CA, USA
    Posts
    4,388

    Re: Yet another problem with shadow volume rendering

    This looks like zbuffer variations on your illumination pass.

    some things to try:

    1) Enable texturing during the zbuffer fill pass, this will keep the paths similar and may produce the same depth value for the generated fragments. Try enabling blending too.

    2) Use glPolygonOffset to apply depth separation between passes.

    3) if using shaders use z invariance.

    You shouldn't need all of these and 1 would be the least attractive option but the easiest solution. Your software should work on some hardware without any modifications.

  3. #3
    Intern Contributor
    Join Date
    Jun 2004
    Location
    Greece
    Posts
    83

    Re: Yet another problem with shadow volume rendering

    the stragne think is that in an other older version of my engine a do exactly the same stuff (but i have different pixel shaders) and it works perfectly! why is that?

    what nay cause this problem?

    thanks

  4. #4
    Intern Contributor
    Join Date
    Apr 2004
    Location
    Sweden
    Posts
    67

    Re: Yet another problem with shadow volume rendering

    Vertex shaders doesn't generate the same position data as fixed function, unless the position-invariant option is used.
    - GLSL: ftransform();
    - ARB_vertex_program: OPTION ARB_position_invariant

    Also, make sure that you draw the shadow volume and the "world" with the same primitives (triangles, strips).

  5. #5
    Intern Contributor
    Join Date
    Jun 2004
    Location
    Greece
    Posts
    83

    Re: Yet another problem with shadow volume rendering

    hey. I use this command in the ARB_vertex_program.
    now the artifacts is less than before. but they still exist. If i try to render the depth pass using a vertex program? is it gonna work? i will try it. But thanks for making my understand what causes the problem!

  6. #6
    Intern Contributor
    Join Date
    Jun 2004
    Location
    Greece
    Posts
    83

    Re: Yet another problem with shadow volume rendering

    oh... finaly didnt need to use a simple vertex program...
    the draw depth has rendering using glBegin(GL_POLYGON)

    I make it glBegin(GL_TRIANGE STRIP) and everything is ok.
    thanks guys!!!

  7. #7
    Intern Contributor
    Join Date
    Jun 2004
    Location
    Greece
    Posts
    83

    Re: Yet another problem with shadow volume rendering

    Can I ask why "Vertex shaders doesn't generate the same position data as fixed function, unless the position-invariant option is used"?

Posting Permissions

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