PDA

View Full Version : Intermediate mode madness



HellKnight
01-31-2006, 04:33 AM
Hey,

OK now I'm drawing some polygons using old plain intermediate mode (for testing only), laying down Z first, and I receive this dready Z-bleeding bug, altought I'm passing *exactly* the same polygons (vertices) to the GL. However, if I use a single shader only, everything seems alright. Only when I'm changing the shaders and draw the polygons this is showing up. I thought it may be related to disabling FP/VP Cg contexts every time a shader is changed (however, they're never being used, so there's no way a poly could be transformed using the fixed pipeline the first time and a custom vertex program the second time), so I'm setting the depth test to LEQUAL, and enable polygon offset right BEFORE drawing each individual polygon, but the Z-bleeding remains...
I tried everything, but still have no idea.

Any ideas?
Thx in advance.

- phil

simongreen
01-31-2006, 04:47 AM
Are you using exactly the same vertex shader in both passes? Are you using fixed function for one? Invariance is not guaranteed between fixed function and vertex shaders.

Which hardware? Driver version?

HellKnight
01-31-2006, 04:57 AM
Fixed pipe for both, that's why I'm so puzzled...

GF6600GT, just upgraded to Forceware 89.98, used to have 89.95, same thing...

dorbie
01-31-2006, 10:13 AM
I think you mean immediate mode.

Even if transform uses fixed function, just a state change can cause Z invariance.

HellKnight
01-31-2006, 11:33 AM
Right I meant immediate mode.

zed
01-31-2006, 01:58 PM
certain things will cause problems with multiplepasses eg user clipplanes, perhaps polygonoffset.
disable everything until it works and then reenable the states one at a time until u find out the culprit

V-man
01-31-2006, 05:00 PM
Originally posted by simongreen:
Are you using fixed function for one? Invariance is not guaranteed between fixed function and vertex shaders.What about using the invariance flag or whatever it's called.
In ARB_vp it was
OPTION ARB_position_invariant
and in GLSL
gl_Position = ftransform();