Re: querying textures bound to default draw/read framebuffers
Posted by ac on Oct 24, 2012; 2:47am
URL: https://forum.jogamp.org/querying-textures-bound-to-default-draw-read-framebuffers-tp4026564p4026593.html
Thanks. I'm trying to get the contents of the texture used as the sink of the MSAA rendering, but still having some issues (for example, rendering the texture results in garbage). My final goal consists in grabbing the contents of the screen at a specific time, and applying a post-processing shader to it.
The following is a simplified snippet of the display() function in my GLEventListener:
public void display(GLAutoDrawable drawable) {
GLCanvas canvas = (GLCanvas)drawable;
GLContext context = drawable.getContext();
GL gl = context.getGL();
// Obtain the texture used a MSAA sink:
GLFBODrawable fboDrawable = (GLFBODrawable)canvas.getDelegatedDrawable();
FBObject backFbo = fboDrawable.getFBObject(GL.GL_BACK);
FBObject.TextureAttachment texAttach = fboBack.getSamplingSink();
// Draw geometry... *
fboBack.syncSamplingSink(gl);
fboBack.bind(gl);
// Now texAttach should be up-to-date with the geometry rendered in (*)
...
Do you see anything drastically wrong here?