PBuffers on macintosh in 1.1b2

I create the PBuffer:

pbuffer = canvas.createOffscreenDrawable(new GLCapabilities(), offscreenSize, offscreenSize);

Then I call pbuffer.display() from the display call in my renderer:

pbuffer.display();

In the pbuffers renderer, I render my offscreen texture, wait for the gl pipe to finish, then copy the data to my texture.

gl.glViewport(0, 0, width, height);
gl.glMatrixMode(GL.GL_PROJECTION);
gl.glLoadIdentity();
gl.glOrtho(0, width, height, 0, -1.0, 1.0);
gl.glMatrixMode(GL.GL_MODELVIEW);
gl.glLoadIdentity();
gl.glClearColor(0.5f, 0.5f, 0.5f, 0);
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);

//
// Normal OpenGL rendering goes here
//

gl.glFinish();

gl.glEnable(GL.GL_TEXTURE_2D);
gl.glBindTexture(GL.GL_TEXTURE_2D, texture);
gl.glCopyTexSubImage2D(GL.GL_TEXTURE_2D, 0, 0, 0, 0, 0, width, height);
gl.glDisable(GL.GL_TEXTURE_2D);

I render a quad with that texture in my “normal” (framebuffer) renderer.

This works fine on both windows and linux, but on macintosh, the texture is solid black.

If I make it render the offscreen texture to the framebuffer, it works everywhere, but has the problem of not working too well if the GLCanvas gets covered by another window.

Any hints? Thoughts?

I tried loading the texture with some initial data, and it never gets overwritten

Some trace outputs show that it spits out a GL error on the CopyTexSubImage2D: 1282 (invalid operation)

I’m confused. The copy is not being made inside a begin/end, and the texture is initialized and works. :-/

I’m not sure whether the Mac OS X pbuffer support has been well tested. Could you file an issue on the JOGL web page and attach a test case?

Sure.

The Mac OS X pbuffer code has been rewritten and the test case you submitted now works (though slowly – but I think this is due to the GeForce 4 MX I’m running with). Please file a new issue if there are still problems, including performance problems. I’ll push a new release build soon; watch the JOGL release thread on this forum.

Note that the HWShadowmapsSimple and ProceduralTexturePhysics demos in the jogl-demos workspace still don’t work on Mac OS X, but I haven’t had a chance to look into why yet. The Mac OS X NVidia drivers probably don’t support some extension that these demos need.

ah, great. Thx. =D