Non-power-of-two textures point blank refusing to work

Started by
15 comments, last by MARS_999 16 years, 11 months ago
Hi guys, thanks for the replies. I've had no time to look into this matter further since I posted; I'm now doing final year exams, which means lots and lots of revision and learning and virtually nothing else.

The problem in this post is from my final year project, which has been handed in now (with plenty of hacks in place to sort out this and several other small/medium/potentially life-threatening bugs which were in it). We're open-sourcing my FYP soon though, and it's being developed further for a conference that's coming up, to add features I didn't have time to implement during the project itself (this is all once my finals are out of the way around May 19th and I've recovered from the week or so of alcohol-fuelled celebration I've promised myself and others [grin]).

I'll open a new thread to announce the project and give more details soon. Hopefully, it'll be something that will interest you all... [smile]
My opinion is a recombination and regurgitation of the opinions of those around me. I bring nothing new to the table, and as such, can be safely ignored.[ Useful things - Firefox | GLee | Boost | DevIL ]
Advertisement
NPOT have always worked for me on Nvidia hardware that supports it...
this is incorrect
glTexImage2D( meTarget, // GL_TEXTURE_BINDING_RECTANGLE_ARB

calling glGetError( ) will report this

alternatively use glIntercept which will tell you this as well

also from my testing power of 2 textures are ~10% quicker than nonpower of 2

NPOT + texture_rectangle_arb are about the same speed
Quote:Original post by zedz
this is incorrect
glTexImage2D( meTarget, // GL_TEXTURE_BINDING_RECTANGLE_ARB

calling glGetError( ) will report this

alternatively use glIntercept which will tell you this as well

Tried GL_TEXTURE_BINDING_RECTANGLE_ARB and GL_TEXTURE_RECTANGLE_ARB, I get invalid operations from glGetError with both.

Quote:Original post by MARS_999
NPOT have always worked for me on Nvidia hardware that supports it...

Yeah, that's the weird thing. As I mentioned, I have that NVIDIA demo which uses NPOT textures, and it works fine. It must be something I'm doing wrong, but I just can't find it...

[Edited by - iNsAn1tY on May 12, 2007 9:17:35 AM]
My opinion is a recombination and regurgitation of the opinions of those around me. I bring nothing new to the table, and as such, can be safely ignored.[ Useful things - Firefox | GLee | Boost | DevIL ]
I hope I'm not stating the obvious here, but you should check glGetError before the call to glTexImage2D just to be sure that the error you're seeing isn't the result of some earlier problem that went unchecked.
one last silly obvious thing to check: check the GL string at load to make sure you are using nVidia's openGL library: a while back I was pounding my head to why things suddenly stopped working and it happened because I specified a greater depth than the current state and asked for a windowed mode so SDL decided to go through the Window's GDI openGL implementation (and this was revealed by looking at glString(GL_VENDOR) and glString(GL_VERSION)....
Close this Gamedev account, I have outgrown Gamedev.
Try this code?

glGenTextures (1, &tex);glBindTexture(GL_TEXTURE_RECTANGLE_ARB, tex);glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_NEAREST);glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_NEAREST);glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP);glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP);glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA8, texSize, texSize, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);//0 if not uploading texture data...


Did you set the filtering code with the ARB extension? Are you using GLEE, GLEW, your own loader?

This topic is closed to new replies.

Advertisement