Re: Non-power of 2 textures no longer working?
Posted by
Sven Gothel on
Oct 17, 2013; 9:12pm
URL: https://forum.jogamp.org/Non-power-of-2-textures-no-longer-working-tp4030292p4030296.html
On 10/17/2013 09:44 PM, nick.collier [via jogamp] wrote:
> We'd like to update to the 2.1.0 release and are doing some tests. It looks
> like non-power 2 textures don't work, although in a previous build (981) they
> seemed to have done. Here's the code:
>
> texture = AWTTextureIO.newTexture(gl.getGLProfile(), img, true);
>
> // this returns true in 2.1.0
> System.out.println(gl.isNPOTTextureAvailable());
>
> float width = texture.getWidth() / 2f;
> float height = texture.getHeight() / 2f;
>
> listIndex = gl.glGenLists(1);
> gl.glNewList(listIndex, GL2.GL_COMPILE);
> gl.glBegin(GL2.GL_QUADS);
>
> TextureCoords tc = texture.getImageTexCoords();
> gl.glTexCoord2f(tc.left(), tc.bottom());
> gl.glVertex2f(-width, -height);
>
> gl.glTexCoord2f(tc.right(), tc.bottom());
> gl.glVertex2f(width, -height);
>
> gl.glTexCoord2f(tc.right(), tc.top());
> gl.glVertex2f(width, height);
>
> gl.glTexCoord2f(tc.left(), tc.top());
> gl.glVertex2f(-width, height);
>
> gl.glEnd();
> gl.glEndList();
>
>
> I realize display lists should no longer be used but this code is old and has
> been part of our application for a while. Regardless, when I use a 30x30 image
> in build 981 of jogl the texture renders as expected. If I use the same image
> in 2.1.0 it doesn't render and there are no error messages. If I resize the
> image to 32x32 it renders as expected. This occurs on both OSX and Linux, but
> I haven't tested on windows. Anyway, I can try to make a proper bug report if
> the above should actually work with a 30x30 image.
Pls file a bug report, I will tackle this issue ASAP.
No test case needed .. assuming you used a GLProfile >= GL3[bc]
which always supports NPOT.
Or are you using some OpenGL [1.1..1.4] context ?
Thank you.
~Sven