PDA

View Full Version : Yet another problem with shadow volume rendering



unreal
11-29-2004, 11:00 AM
Hello!
I have a new problem when i draw the shadow volumes. I get some artifacts. Here is a screenshot:

http://bekengine.periergoi.gr/Screenshots/shadow_volume_prob.JPG

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

any idea what is going on?

thanks in advance.

dorbie
11-29-2004, 11: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.

unreal
11-29-2004, 12:03 PM
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

Sunray
11-29-2004, 12:06 PM
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).

unreal
11-30-2004, 01: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!

unreal
11-30-2004, 01: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.
thanks guys!!!

unreal
11-30-2004, 11: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"?