View Full Version : Rendering frame and filled faces simultaneously

03-22-2012, 10:37 AM
Hi everybody!
My problem is the following. I have to render model's frame and faces at the same time for they to look like this:

I'm trying to render the faces first (using GL_QUADS) and then frame (GL_LINES), but picture I get isn't proper because frame lines are broken and ungly, and when face is looked from right angle frame isn't visible at all:

I tried to set depth function to 'less or equal' but it doesn't work too. As far as I understand it's due to round-off errors during vertex transformations .

Also I tried to render frame a bit moved towards viewpoint. It helped to some extent, but result is still unsatisfactory. How can I fix it?

carsten neumann
03-22-2012, 12:59 PM
Take a look at glPolygonOffset (http://www.opengl.org/sdk/docs/man/xhtml/glPolygonOffset.xml).