jogl pBuffer, render large (2000x2000) offscreen image

Hi, everybody !
I have a question:

I’ve been trying to use the jogl pBuffer to render an image directly to a bitmap. (I normally render it in real-time in a small 800x600 GLCanvas, but I need the ability to save a very high quality version of the same image).
I build the pBuffer using the GLCanvas.createOffscreenDrawable method. When I draw, I get the properly scaled image - larger size, of course, BUT only a part of it. The rest is black pixels. The part that I do get is the same size as the on-screen GLCanvas.

I thought the purpose of pBuffers was to be able to bypass the screen-size/Canvas size limitation. Am I doing something wrong?

Thank you,
Andrei

I’d bet that you aren’t changing the glViewport before you render to the large canvas, thus you are getting your image rendered to the 800x600 origin corner of your giant 2k texture.

Rather than making your giant texture 2k by 2k, you might want to maintain the aspect ratio of the original target, (4:3), so you don’t have to change your perspective matrix.

Anarchotron, thanks for the answer. Unfortunately, I am already changing the glViewport to (0, 0, 2000, 2000) (thus, I get the properly scaled image - larger - but only a chunk of it).
I wonder if this is a limitation of the pBuffer implementation in jogl? It seems that the pBuffer can’t render offscreen any more than the GLCanvas can.

Andrei

Have you tried upgrading to latest drivers?
How much video RAM does the video card have?
Have you queried the maximum supported
dimensions via the glGetXXX() calls? Have you
tried using the DebugGL pipeline to check
for any errors? These are standard things
I do to nail down where the problem might be.

Have you tried a few pbuffer sizes rather than going for the huge size immediately? Does anything larger than your canvas size have any different result? There is basically no connection between the GLCanvas and the GLPbuffer once the pbuffer has been created.

I’ve also found it necessary in some cases to maintain power-of-two dimensions on the width and height of the pbuffer due to apparent bugs in reading back pixels.