1
\$\begingroup\$

I get some strange artifacting with textures depending on their size. I run OpenGL 3.3 with an GTX 580 so it should definitely support non power of two textures. I've narrowed down the problem specifically to the texture's size, I've tried checking if transparency had anything to do with it, color channels etc.

Texture artifacting

As you can see, the 512x512 and 300x300 textures look just fine but the 437x437 is all distorted. What could be the cause of this and how can it be fixed? I could of course just stick to power of two textures which seem to work fine but since this is an personal educational project I really want to understand what's going on.

\$\endgroup\$
  • \$\begingroup\$ Do you have mipmapping on or off? \$\endgroup\$ – Alan Wolfe Jul 13 '15 at 20:32
  • \$\begingroup\$ Mipmapping is off (or I haven't make a conscious decision to enable it). I just upload the texture using glTexImage2D and the sampler I'm using is set to use GL_LINEAR for GL_TEXTURE_MIN_FILTER and GL_TEXTURE_MAG_FILTER. \$\endgroup\$ – Havsmonstret Jul 14 '15 at 9:03
  • 1
    \$\begingroup\$ Looks like you forgot to glPixelStorei(GL_UNPACK_ALIGNMENT, 1) \$\endgroup\$ – kolrabi Jul 14 '15 at 10:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.