Z-Fighting anyone?
3 posters
Z-Fighting anyone?
Hi,
I am having an issue where my solid cylinder object appears to be "see-through". There's little specs of inside material showing, when it should be a solid cylinder "shell".
From what I can tell this issue is called z-fighting, and happens in OpenGL.
Has anyone experienced this when rendering sio2 objects? Are there any solutions?
Thanks in advance
I am having an issue where my solid cylinder object appears to be "see-through". There's little specs of inside material showing, when it should be a solid cylinder "shell".
From what I can tell this issue is called z-fighting, and happens in OpenGL.
Has anyone experienced this when rendering sio2 objects? Are there any solutions?
Thanks in advance
jj- Posts : 77
Join date : 2008-09-24
Re: Z-Fighting anyone?
- Code:
// Enable polygon offset to avoid zfighting
glEnable( GL_POLYGON_OFFSET_FILL );
// If you are using the simulator theses values
// will do.
glPolygonOffset( -2.0f, 2.0f );
// Setup the polygon offset, on the device polygon
// offset require extreme value in order to work
// correctly. Try setting the optimal combination
// proper to your application. The following value
// will work but are not optimized...
//glPolygonOffset( -10.0f, -10.0f );
...
...
// Disable polygon offset
glDisable( GL_POLYGON_OFFSET_FILL );
Re: Z-Fighting anyone?
You should also check that your model's normals are correct.
Best,
-j
Best,
-j
meteors- Posts : 241
Join date : 2008-11-08
Location : Sunny Florida
Permissions in this forum:
You cannot reply to topics in this forum