Z-Fighting anyone?

Go down

Z-Fighting anyone?

Post  jj on Wed Nov 19, 2008 10:39 pm


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


Posts : 77
Join date : 2008-09-24

View user profile

Back to top Go down

Re: Z-Fighting anyone?

Post  sio2interactive on Thu Nov 20, 2008 1:59 am


         // 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 );


Posts : 1526
Join date : 2008-08-26
Age : 39
Location : Shanghai

View user profile http://sio2interactive.com

Back to top Go down

Re: Z-Fighting anyone?

Post  meteors on Thu Nov 20, 2008 7:01 am

You should also check that your model's normals are correct.


Posts : 241
Join date : 2008-11-08
Location : Sunny Florida

View user profile

Back to top Go down

Re: Z-Fighting anyone?

Post  Sponsored content

Sponsored content

Back to top Go down

Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum