Login  Register

Re: glReadBuffer() behavior on MAC

Posted by Sven Gothel on Jan 29, 2013; 8:47pm
URL: https://forum.jogamp.org/glReadBuffer-behavior-on-MAC-tp4028039p4028055.html

On 01/29/2013 09:38 PM, stepasite [via jogamp] wrote:
> Sven,
>
> thanks for a thorough description of the problem.
>
> Given your reply I understand that when reading a buffer (when FBO rendering
> enabled) I always get front buffer data. Reading back buffer would be
> difficult (maybe impossible) as I don't have access to your FBO objects so I
> cannot bind the right one. Am I right?

Sort of, yes.

However, you can have access to the FBObject for each framebuffer name (front, back, ..).
GLFBODrawable interface is public:

GLFBODrawable -> GLDrawable
GLOffscreenAutoDrawable.FBO -> GLOffscreenAutoDrawable, GLFBODrawable

So if true == glCaps.isFBO() then you may cast the GLAutoDrawable
instance to GLOffscreenAutoDrawable.FBO and can access the FBO via
  FBObject fbo = ((GLOffscreenAutoDrawable.FBO)autoDrawable).getFBObject(bufferName);
or
  FBObject fbo = ((GLFBODrawable)drawable).getFBObject(bufferName);

So no detail is hidden, all transparent.

>
> But I think reading pixels just from front buffer is Okay for me as I need to
> get pixel data once the scene is rendered (and glSwapBuffers() called).
>
yup


> Thanks for your help and clarification!
> Pavel

~Sven



signature.asc (911 bytes) Download Attachment