0

I have a 512X512 texture which holds a number of images that i want to use in my application. After adding the image data to the texture i save the texture coords for the individual images. Later i apply these on some quads that i am drawing. The texture has mipmapping activated.

When i take a screenshot of the rendered scene at exactly the same instance in two different runs of the applications, i notice that there are differences in the image only among those quads textured using this mipmapped texture. Can mipmapping cause such an issue?

sn710
  • 581
  • 5
  • 20
  • Could you show the screenshots? – harold May 08 '14 at 16:00
  • I am sorry, i dont have access to them currently. But a simple image comparison done using bmp compare shows differences not only at borders but also within these quads having the textures – sn710 May 08 '14 at 16:07
  • 4
    What you should really do to identify an issue like this is use false-colored mipmaps for each level. (e.g. ***solid*** red, yellow, blue, green). Then you can detect any differences in the bands of colors. Anisotropic filtering could be to blame if the camera is even slightly at a different angle, by the way. – Andon M. Coleman May 08 '14 at 16:34
  • 1
    If you use a texture atlas with mipmapping, you have to be very careful with mipmapping, the different images will blend into each other if you don't take any precautions. So even without anisotropic filtering, the slightest difference in transformation might have a noticable effect. – derhass May 08 '14 at 18:46

1 Answers1

0

My best guess is that it has to do with precisions in your shader. Check out this problem that I had (and fought with for a while) and my solution:

opengl texture mapping off by 5-8 pixels

It probably is a combination of mimapping's automatic scaling of your texture atlas and the precision hints in your shader code.

Also see the other linked question:

Why is a texture coordinate of 1.0 getting beyond the edge of the texture?

Community
  • 1
  • 1
badweasel
  • 2,349
  • 1
  • 19
  • 31