View Full Version : Yet another problem with shadow volume rendering
11-29-2004, 10:00 AM
I have a new problem when i draw the shadow volumes. I get some artifacts. Here is a screenshot:
and here is my source:
any idea what is going on?
thanks in advance.
11-29-2004, 10:51 AM
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.
11-29-2004, 11:03 AM
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?
11-29-2004, 11:06 AM
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).
11-30-2004, 12:29 AM
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!
11-30-2004, 12:44 AM
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.
11-30-2004, 10:46 AM
Can I ask why "Vertex shaders doesn't generate the same position data as fixed function, unless the position-invariant option is used"?
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.