tags:

views:

24

answers:

1

I'm going to have meshes with several coplanar polygons, all lying in a certain plane, that I'm not going to be able to eliminate.

These polygons have a specific draw order. Some polygons are behind other polygons. If I turn off depth testing I'll have the effect I want, but I want to be able to position this mesh in a 3D scene.

I do not trust glPolygonOffset because I'll potentially have several of these overlapping polygons and am am worried about the cumulative effects of the offset.

+4  A: 

f I turn off depth testing I'll have the effect I want, but I want to be able to position this mesh in a 3D scene.

Simply disable writing to z-buffer, without disabling depth test.

glDepthMask(GL_FALSE);

Make sure to render all polygons that doesn't require glDepthMask(GL_FALCE) before rendering any polygons with glDepthMask(GL_FALSE); Otherwise object will be incorrectly positioned.

If you can't do that, then you should change your geometry or use texture instead.

glDepthMask documentation

SigTerm
The depth mask trick should do, though I'm starting to realize that I'm going to have to figure out how to properly clip my polygons for real robustness.The reason I'm making an issue out of clipping is because some of my polygons actually represent bezier curves.
AJM