PDA

View Full Version : weird non pow2 problem opengl3.3



ravage
07-16-2010, 05:22 AM
I've found that for some reason if I load a non pow2 texture it get sheared. This forces me to shear it back into place using a matrix multiplication and setting it the Xy as the ratio (height/width) to fix the problem. I figured that opengl should have done this by itself right. I've read the spec but maybe I missed something. I'm sure it's not my texture coordinates since it works fine if I use a 512^2 texture.

texture size wxh: 699x1008 (honestly this was a test texture).

shouldn't opengl automatically do this as I load the data using glTexImage2D?

nvidia 9500 gt : 257.21 force drivers.

I've also found that this driver crashes my app if I enable TEXTURE_CUBE_SEAMLESS which is weird as I read the spec on that and I don't see anything about when or if it fails.

Jan
07-16-2010, 05:58 AM
Try glPixelStorei(GL_PACK_ALIGNMENT, 1) before uploading the texture.

ravage
07-16-2010, 09:23 AM
Thanks that helped and because of that I realized the data I had for glTexImage* was the cause.

Jan
07-16-2010, 01:26 PM
Glad i could help :-)