OpenGL textured image blurry

I am trying to create a mipmapped textured image representing height. The image should be 940 x 618. I understand that my texture should have a width and height of power 2. At the moment, I tried to gradually perform all my texturing in squares (for example, 64 x 64 or 128 x 128, even 512 x 512), but the image still looks blurry. Any idea on how to better texture an image of this size?

+3
source share
4 answers

Use a texture of 1024x1024 and place your image only in a part of the image, 940x618. Then use the values ​​940.0 / 1024.0 and 618.0 / 1024.0 for maximum texture coordinates or scale TEXTURE_MATRIX. This will make a 1: 1 display for your pixels. You may also need to shift the model by half a pixel to get a perfect fit, it depends on your setup and viewing the model.

This is the technique I used in this screensaver that I made for Mac. http://memention.com/void/ It captures the contents of the screen and uses it as a texture for some 3D effects, and I really wanted the pixel to fit perfectly.

+3
source

, 2 . , , , . ?

+2

The texture probably doesn't display 1: 1, and you have GL_LINEAR or GL_NEAREST filtering. Try higher resolution texture, mipmapping and 1: 1 screen display.

+1
source

Use a texture size of 940x618 (if this is really the size of the surface on which it is applied), and set GL_LINEAR to thumbnail / enlarge the texture. This should give you the results that you are after.

0
source

All Articles