Unfortunately, due to differences in polygon versus line rasterization, a "less or equal" depth test will still produce z-fighting. (You'd need the old SGI plane equation extension to make this work, to force line line fragments to have Z values that match the polygon's plane equation. Most hardware doesn't support this extension.)
 
Instead, I'd modify the algorithm below slightly: In the second pass (when rendering in line mode), enable polygon offset to ensure the lines don't z-fight with the polygon.
 
(As an additional note, this algorithm will only work if you have polygonal geometry.)
 
Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com
303 859 9466
 
 

The OSG does not have such a built-in feature afaik
Maybe you can draw your object in the z-buffer (disabling the color buffer output) and then draw the wireframe in the color buffer with a "less or equal" depth function.
Well, this is the approach I would use; implementing the technique described in the article seems very difficult, but it might be possible with a (very complex) shader.

Thibault


_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to