Hi, I am binding a texture with a function that allows for non power of 2 textures.
I can bind a 1920x1080 texture just fine, when I try to bind a 3840x2160 texture it cuts off and distorts and does not bind in the same way.
Here is the gl info from my gfx card
GL_MAX_TEXTURE_SIZE = 16384
GL_MAX_3D_TEXTURE_SIZE = 2048
GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB = 16384
GL_MAX_RECTANGLE_TEXTURE_SIZE_NV = 16384
Because I am binding to a sphere does that mean I am limited to the 2048 max texture size?
If not does anyone know why this would not be the same?
Here is the code- first the bind and unbind methods
void testApp::bindMyTexture(ofTexture tex) {
tex.bind();
glMatrixMode(GL_TEXTURE);
glPushMatrix();
glLoadIdentity();
ofTextureData texData = tex.getTextureData();
if(texData.textureTarget == GL_TEXTURE_RECTANGLE_ARB) {
glScalef(tex.getWidth(), tex.getHeight(), 1.0f);
} else {
glScalef(tex.getWidth() / texData.tex_w, tex.getHeight() / texData.tex_h, 1.0f);
}
glMatrixMode(GL_MODELVIEW);
}
void testApp::unbindMyTexture(ofTexture tex) {
tex.unbind();
glMatrixMode(GL_TEXTURE);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
}
And now in my draw
if (grabber.isFrameNew()) {
bindMyTexture(grabber.getTextureReference());
ofPushMatrix();
sphere.draw();
ofPopMatrix();
unbindMyTexture(grabber.getTextureReference());
}
or
bindMyTexture(syphonFbo.getTextureReference());
ofPushMatrix();
sphere.draw();
ofPopMatrix();
unbindMyTexture(syphonFbo.getTextureReference());
Thanks a lot