Login  Register

Re: off screen rendering jogl2

Posted by neilt on May 02, 2014; 8:03am
URL: https://forum.jogamp.org/off-screen-rendering-jogl2-tp4032257p4032258.html

OK so I have fixed this myself, the problem was as follows:

In jogl 1.0 we used the following to get the buffered image :

CAPTURE = Screenshot.readToBufferedImage(OFFSCREEN_DIM.width,OFFSCREEN_DIM.height);

In jogl 2.0 we used:

CAPTURE = (new AWTGLReadBufferUtil(currentBuffer.getGLProfile() , true)).readPixelsToBufferedImage( currentBuffer.getGL() , true );

To fix the problem we changed the above line to false in the constructor:

CAPTURE = (new AWTGLReadBufferUtil(currentBuffer.getGLProfile() , false)).readPixelsToBufferedImage( currentBuffer.getGL() , true );

I have to say this was pure luck, the above class is completely undocumented so how are we supposed to use it successfully? What does the 'alpha' parameter that I changed to false indicate?