View Full Version : glPolygonOffset & stencil buffer problem?

11-14-2002, 05:57 AM
I have two polygons that are coplanar so I use glPolygonOffset, which works great. But, here is my problem: When I draw these polygons using the stencil buffer (clearing the stencil buffer after each one), the polygon offset doesn't seem to work anymore.

Does this problem sound familiar to anyone?


11-14-2002, 06:55 AM
Could you be a little more specific, because I'm not exactly sure what it is you are trying to do? Why do you clear the stencil buffer after drawing each polygon? What are you using the stencil buffer for?

Regards Anders

11-14-2002, 06:57 AM
[This message has been edited by GameMaker (edited 11-14-2002).]

11-14-2002, 07:03 AM
I am drawing a capping texture on the cut-out part of the models.

BTW: Is clearing the stencil buffer a fast operation? Right now I clear the stencil buffer between drawing each object.

I could use a different bit for each object that I am stenciling and then draw the capping for each one at the end of the entire stenciling process. But that sounds a lot more complicated.