z-biasing

With z-biasing, Direct3D allows you to display one surface in front of another even if the surfaces have the same depth values. Setting a higher z-bias makes it more likely that your polygons will be visible when they’re displayed with other polygons that are coplanar.
Can I use this technique in OpenGL (method, parameters) ?

Have a look at glPolygonOffset at :
http://tc1.chemie.uni-bielefeld.de/doc/OpenGL/hp/Reference/glPolygonOffset.html

In glPolygonOffset(…) the offset is added before the depth test is performed and before the value is written into the depth buffer.
I don’t want to change/move the depth values !

Does it work if you use glDepthMask(0) ? This will disable writing to the Z-Buffer but will perform the Depth Test…

Eric

No, …
The original depth value should be written in the depth buffer.

Well, is it really all that important that the depth values remain the same? If so, why? Someone may be able to help with an alternative.

Hey kurt_p,

Do you know how z-biasing works???

It works exactly as glPolygonOffset.

So, if you “don’t want to change/move the depth values” - you can’t use z-biasing in Direct3D.

from Direct3D SDK:

A … application can help ensure that coplanar polygons are rendered properly by adding a bias to the z-values that the system uses when rendering the sets of coplanar polygons.