Using textures - jogl

Hi,

I have the following problem:
I bind a 2d-Texture (the picture contains one grey rectangle ) on a 3d-object - works fine. When I zoom into the screen: small dots, which are not in the picture, appear - zooming further these dots disappear. Can somebody tell me why these dots appear and maybe how I can avoid them?
Another problem is, that when I bind a blue textures - jogl displays this textures in orange. What’s the reason for this colorchange?

Thanks!!

Do you have two nearly-coplanar polygons? The dots might be a polygon in the back “z-fighting” to show through the topmost one.

Sounds like you need to switch from e.g. GL_RGB to GL_BGR or GL_RGBA to GL_BGRA.

Yes, I think I have nearly-coplanar polygons. Is it possible to suppress that " z-fighting"?

You can do any of:

  • Increase the precision of the z-buffer
  • Make your near and far clipping planes closer together
  • Use glPolygonOffset to force one of the polygons to appear in front of the other

to reduce z-fighting