Java Code Examples for com.jogamp.opengl.GL3#glGenFramebuffers()

The following examples show how to use com.jogamp.opengl.GL3#glGenFramebuffers() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Gl_320_fbo_multisample_explicit.java    From jogl-samples with MIT License 6 votes vote down vote up
private boolean initFramebuffer(GL3 gl3) {

        gl3.glGenFramebuffers(1, framebufferRenderName);
        gl3.glBindFramebuffer(GL_FRAMEBUFFER, framebufferRenderName.get(0));
        gl3.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureName.get(Texture.MULTISAMPLE_COLORBUFFER),
                0);
        gl3.glFramebufferTexture(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, textureName.get(Texture.MULTISAMPLE_DEPTHBUFFER),
                0);

        if (!isFramebufferComplete(gl3, framebufferRenderName.get(0))) {
            return false;
        }
        gl3.glBindFramebuffer(GL_FRAMEBUFFER, 0);

        return true;
    }
 
Example 2
Source File: Gl_320_primitive_line_msaa.java    From jogl-samples with MIT License 6 votes vote down vote up
private boolean initFramebuffer(GL3 gl3) {

        gl3.glGenFramebuffers(Texture.MAX, framebufferName);

        gl3.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(Texture.RENDERBUFFER));
        gl3.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureName.get(Texture.RENDERBUFFER), 0);

        gl3.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(Texture.COLORBUFFER));
        gl3.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureName.get(Texture.COLORBUFFER), 0);

        if (!isFramebufferComplete(gl3, framebufferName.get(Texture.RENDERBUFFER))) {
            return false;
        }
        if (!isFramebufferComplete(gl3, framebufferName.get(Texture.COLORBUFFER))) {
            return false;
        }

        gl3.glBindFramebuffer(GL_FRAMEBUFFER, 0);
        return true;
    }
 
Example 3
Source File: Gl_320_fbo_blit.java    From jogl-samples with MIT License 6 votes vote down vote up
private boolean initFramebuffer(GL3 gl3) {

        gl3.glGenFramebuffers(Framebuffer.MAX, framebufferName);

        gl3.glGenRenderbuffers(1, colorRenderbufferName);
        gl3.glBindRenderbuffer(GL_RENDERBUFFER, colorRenderbufferName.get(0));
        gl3.glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA8, FRAMEBUFFER_SIZE.x, FRAMEBUFFER_SIZE.y);

        gl3.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(Framebuffer.RENDER));
        gl3.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, colorRenderbufferName.get(0));
        if (!isFramebufferComplete(gl3, framebufferName.get(Framebuffer.RENDER))) {
            return false;
        }
        gl3.glBindFramebuffer(GL_FRAMEBUFFER, 0);

        gl3.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(Framebuffer.RESOLVE));
        gl3.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureName.get(Texture.COLORBUFFER), 0);
        if (!isFramebufferComplete(gl3, framebufferName.get(Framebuffer.RESOLVE))) {
            return false;
        }
        gl3.glBindFramebuffer(GL_FRAMEBUFFER, 0);

        return checkError(gl3, "initFramebuffer");
    }
 
Example 4
Source File: Gl_320_fbo_srgb.java    From jogl-samples with MIT License 6 votes vote down vote up
private boolean initFramebuffer(GL3 gl3) {

        gl3.glGenFramebuffers(1, framebufferName);
        gl3.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(0));
        gl3.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureName.get(Texture.COLORBUFFER), 0);
        gl3.glFramebufferTexture(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, textureName.get(Texture.RENDERBUFFER), 0);

        if (!isFramebufferComplete(gl3, framebufferName.get(0))) {
            return false;
        }

        gl3.glBindFramebuffer(GL_FRAMEBUFFER, 0);

        int encodingLinear = GL_LINEAR;
        int encodingSRGB = GL_SRGB;

        int[] encoding = {0};
        gl3.glGetFramebufferAttachmentParameteriv(GL_DRAW_FRAMEBUFFER, GL_BACK_LEFT,
                GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, encoding, 0);

        return true;
    }
 
Example 5
Source File: Gl_330_blend_rtt.java    From jogl-samples with MIT License 6 votes vote down vote up
private boolean initFramebuffer(GL3 gl3) {

        gl3.glGenFramebuffers(1, framebufferName);
        gl3.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(0));

        for (int i = Texture.R; i <= Texture.B; ++i) {
            gl3.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + (i - Texture.R), texture2dName.get(i), 0);
        }

        int[] drawBuffers = new int[3];
        drawBuffers[0] = GL_COLOR_ATTACHMENT0;
        drawBuffers[1] = GL_COLOR_ATTACHMENT1;
        drawBuffers[2] = GL_COLOR_ATTACHMENT2;

        gl3.glDrawBuffers(3, drawBuffers, 0);

        if (!isFramebufferComplete(gl3, framebufferName.get(0))) {
            return false;
        }

        return checkError(gl3, "initFramebuffer");
    }
 
Example 6
Source File: Gl_320_fbo_rtt.java    From jogl-samples with MIT License 6 votes vote down vote up
private boolean initFramebuffer(GL3 gl3) {

        gl3.glGenFramebuffers(1, framebufferName);
        gl3.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(0));
        gl3.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureName.get(0), 0);
        gl3.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, textureName.get(1), 0);
        gl3.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT2, textureName.get(2), 0);
        int[] drawBuffers = {GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT2};
        gl3.glDrawBuffers(3, drawBuffers, 0);
        if (!isFramebufferComplete(gl3, framebufferName.get(0))) {
            return false;
        }

        gl3.glBindFramebuffer(GL_FRAMEBUFFER, 0);
        //GL_ARB_ES3_1_compability
        //GLenum const Buffers = GL_BACK; 
        //glDrawBuffers(1, &Buffers);
        gl3.glDrawBuffer(GL_BACK);
        if (!isFramebufferComplete(gl3, 0)) {
            return false;
        }

        return checkError(gl3, "initFramebuffer");
    }
 
Example 7
Source File: Gl_320_fbo_depth_multisample.java    From jogl-samples with MIT License 6 votes vote down vote up
private boolean initFramebuffer(GL3 gl3) {

        boolean validated = true;

        gl3.glGenFramebuffers(Framebuffer.MAX, framebufferName);
        gl3.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(Framebuffer.DEPTH_MULTISAMPLE));
        gl3.glFramebufferTexture(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, textureName.get(Texture.MULTISAMPLE), 0);
        gl3.glDrawBuffer(GL_NONE);

        if (!isFramebufferComplete(gl3, framebufferName.get(Framebuffer.DEPTH_MULTISAMPLE))) {
            return false;
        }

        gl3.glBindFramebuffer(GL_FRAMEBUFFER, 0);
        return validated && checkError(gl3, "initFramebuffer");
    }
 
Example 8
Source File: Gl_320_fbo_srgb_blend.java    From jogl-samples with MIT License 6 votes vote down vote up
private boolean initFramebuffer(GL3 gl3) {

        gl3.glGenFramebuffers(1, framebufferName);
        gl3.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(0));
        gl3.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureName.get(Texture.COLORBUFFER), 0);

        if (!isFramebufferComplete(gl3, framebufferName.get(0))) {
            return false;
        }
        int encodingLinear = GL_LINEAR;
        int encodingSRGB = GL_SRGB;

        gl3.glBindFramebuffer(GL_FRAMEBUFFER, 0);
        int[] encoding = {0};
        gl3.glGetFramebufferAttachmentParameteriv(GL_DRAW_FRAMEBUFFER, GL_BACK_LEFT,
                GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, encoding, 0);

        return true;
    }
 
Example 9
Source File: Gl_320_fbo_shadow.java    From jogl-samples with MIT License 6 votes vote down vote up
private boolean initFramebuffer(GL3 gl3) {

        gl3.glGenFramebuffers(1, framebufferName);

        gl3.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(0));
        gl3.glFramebufferTexture(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, textureName.get(0), 0);
        gl3.glDrawBuffer(GL_NONE);
        if (!isFramebufferComplete(gl3, framebufferName.get(0))) {
            return false;
        }
        gl3.glBindFramebuffer(GL_FRAMEBUFFER, 0);
        gl3.glDrawBuffer(GL_BACK);
        if (!isFramebufferComplete(gl3, 0)) {
            return false;
        }

        return true;
    }
 
Example 10
Source File: Gl_320_fbo_integer.java    From jogl-samples with MIT License 5 votes vote down vote up
private boolean initFramebuffer(GL3 gl3) {

        gl3.glGenFramebuffers(1, framebufferName);

        gl3.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(0));
        gl3.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureName.get(Texture.RENDERBUFFER), 0);
        if (!isFramebufferComplete(gl3, framebufferName.get(0))) {
            return false;
        }
        gl3.glBindFramebuffer(GL_FRAMEBUFFER, 0);

        return checkError(gl3, "initFramebuffer");
    }
 
Example 11
Source File: Gl_320_fbo_srgb_decode_ext.java    From jogl-samples with MIT License 5 votes vote down vote up
private boolean initFramebuffer(GL3 gl3) {

        gl3.glGenFramebuffers(1, framebufferName);
        gl3.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(0));
        gl3.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureName.get(Texture.COLORBUFFER), 0);
        gl3.glFramebufferTexture(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, textureName.get(Texture.RENDERBUFFER), 0);

        if (!isFramebufferComplete(gl3, framebufferName.get(0))) {
            return false;
        }

        gl3.glBindFramebuffer(GL_FRAMEBUFFER, 0);
        return true;
    }
 
Example 12
Source File: Gl_320_fbo_multisample.java    From jogl-samples with MIT License 5 votes vote down vote up
private boolean initFramebuffer(GL3 gl3) {

        gl3.glGenFramebuffers(Framebuffer.MAX, framebufferName);

        int[] buffersRender = new int[]{GL_COLOR_ATTACHMENT0};
        gl3.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(Framebuffer.RENDER));
        gl3.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureName.get(Texture.MULTISAMPLE), 0);
        gl3.glDrawBuffers(1, buffersRender, 0);
        if (!isFramebufferComplete(gl3, framebufferName.get(Framebuffer.RENDER))) {
            return false;
        }
        int[] buffersResolve = new int[]{GL_COLOR_ATTACHMENT0};
        gl3.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(Framebuffer.RESOLVE));
        gl3.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureName.get(Texture.COLORBUFFER), 0);
        gl3.glDrawBuffers(1, buffersResolve, 0);
        if (!isFramebufferComplete(gl3, framebufferName.get(Framebuffer.RESOLVE))) {
            return false;
        }

        gl3.glBindFramebuffer(GL_FRAMEBUFFER, 0);
        gl3.glDrawBuffer(GL_BACK);
        if (!isFramebufferComplete(gl3, 0)) {
            return false;
        }

        return checkError(gl3, "initFramebuffer");
    }
 
Example 13
Source File: Gl_300_fbo_multisample.java    From jogl-samples with MIT License 5 votes vote down vote up
private boolean initFramebuffer(GL3 gl3) {

        gl3.glGenRenderbuffers(1, colorRenderbufferName);
        gl3.glBindRenderbuffer(GL_RENDERBUFFER, colorRenderbufferName.get(0));
        // The second parameter is the number of samples.
        gl3.glRenderbufferStorageMultisample(GL_RENDERBUFFER, 8, GL_RGBA8, FRAMEBUFFER_SIZE.x, FRAMEBUFFER_SIZE.y);

        gl3.glGenFramebuffers(Framebuffer.MAX, framebufferName);
        gl3.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(Framebuffer.RENDER));
        gl3.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, 
                colorRenderbufferName.get(0));
        if (!isFramebufferComplete(gl3, framebufferName.get(Framebuffer.RENDER))) {
            return false;
        }
        gl3.glBindFramebuffer(GL_FRAMEBUFFER, 0);

        gl3.glBindTexture(GL_TEXTURE_2D, textureName.get(Texture.RESOLVE));
        gl3.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
        gl3.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
        gl3.glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, FRAMEBUFFER_SIZE.x, FRAMEBUFFER_SIZE.y, 0, GL_RGBA,
                GL_UNSIGNED_BYTE, null);

        gl3.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(Framebuffer.RESOLVE));
        gl3.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, textureName.get(Texture.RESOLVE),
                0);
        if (!isFramebufferComplete(gl3, framebufferName.get(Framebuffer.RESOLVE))) {
            return false;
        }
        gl3.glBindFramebuffer(GL_FRAMEBUFFER, 0);

        return checkError(gl3, "initFramebuffer");
    }
 
Example 14
Source File: Gl_320_fbo_blend.java    From jogl-samples with MIT License 5 votes vote down vote up
private boolean initFramebuffer(GL3 gl3) {

        gl3.glGenFramebuffers(1, framebufferName);
        gl3.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(0));
        gl3.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureName.get(Texture.COLORBUFFER), 0);

        if (!isFramebufferComplete(gl3, framebufferName.get(0))) {
            return false;
        }

        gl3.glBindFramebuffer(GL_FRAMEBUFFER, 0);
        return true;
    }
 
Example 15
Source File: Gl_320_fbo_layered.java    From jogl-samples with MIT License 5 votes vote down vote up
private boolean initFramebuffer(GL3 gl3) {

        gl3.glGenFramebuffers(1, framebufferName);
        gl3.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(0));
        gl3.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureColorbufferName.get(0), 0);

        if (!isFramebufferComplete(gl3, framebufferName.get(0))) {
            return false;
        }

        gl3.glBindFramebuffer(GL_FRAMEBUFFER, 0);
        return true;
    }
 
Example 16
Source File: Gl_320_fbo_depth.java    From jogl-samples with MIT License 5 votes vote down vote up
private boolean initFramebuffer(GL3 gl3) {

        gl3.glGenFramebuffers(1, framebufferName);
        gl3.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(0));
        gl3.glFramebufferTexture(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, textureName.get(Texture.RENDERBUFFER), 0);
        gl3.glDrawBuffer(GL_NONE);

        if (!isFramebufferComplete(gl3, framebufferName.get(0))) {
            return false;
        }

        gl3.glBindFramebuffer(GL_FRAMEBUFFER, 0);
        return true;
    }
 
Example 17
Source File: Gl_320_fbo_blend_points.java    From jogl-samples with MIT License 5 votes vote down vote up
private boolean initFramebuffer(GL3 gl3) {

        gl3.glGenFramebuffers(1, framebufferName);
        gl3.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(0));
        gl3.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureName.get(Texture.COLORBUFFER), 0);

        if (!isFramebufferComplete(gl3, framebufferName.get(0))) {
            return false;
        }

        gl3.glBindFramebuffer(GL_FRAMEBUFFER, 0);
        return true;
    }
 
Example 18
Source File: Gl_320_fbo.java    From jogl-samples with MIT License 5 votes vote down vote up
private boolean initFramebuffer(GL3 gl3) {

        gl3.glGenFramebuffers(1, framebufferName);
        gl3.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(0));
        gl3.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureName.get(Texture.COLORBUFFER), 0);
        gl3.glFramebufferTexture(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, textureName.get(Texture.RENDERBUFFER), 0);

        if (!isFramebufferComplete(gl3, framebufferName.get(0))) {
            return false;
        }

        gl3.glBindFramebuffer(GL_FRAMEBUFFER, 0);
        return true;
    }
 
Example 19
Source File: HitTester.java    From constellation with Apache License 2.0 5 votes vote down vote up
@Override
public void init(final GLAutoDrawable drawable) {
    final GL3 gl = drawable.getGL().getGL3();
    // Hit testing.
    // Create an FBO name and bind a new FBO.
    gl.glGenFramebuffers(1, hitTestFboName, 0);
    gl.glBindFramebuffer(GL3.GL_DRAW_FRAMEBUFFER, hitTestFboName[0]);

    // Create a depth buffer object and attach it.
    gl.glGenRenderbuffers(1, hitTestDepthBufferName, 0);
    gl.glBindRenderbuffer(GL3.GL_RENDERBUFFER, hitTestDepthBufferName[0]);
    gl.glRenderbufferStorage(GL3.GL_RENDERBUFFER, GL3.GL_DEPTH_COMPONENT32F, width, height);

    // Create an RBO and bind it.
    gl.glGenRenderbuffers(1, hitTestRboName, 0);
    gl.glBindRenderbuffer(GL3.GL_RENDERBUFFER, hitTestRboName[0]);

    // Allocate memory to back the RBO.
    // Using R32F gives us plenty of unique values (2**22 in the mantissa without
    // worrying about floating point stuff).
    gl.glRenderbufferStorage(GL3.GL_RENDERBUFFER, GL3.GL_R32F, width, height);

    // Attach the render buffers.
    gl.glFramebufferRenderbuffer(GL3.GL_DRAW_FRAMEBUFFER, GL3.GL_DEPTH_ATTACHMENT, GL3.GL_RENDERBUFFER, hitTestDepthBufferName[0]);
    gl.glFramebufferRenderbuffer(GL3.GL_DRAW_FRAMEBUFFER, GL3.GL_COLOR_ATTACHMENT0, GL3.GL_RENDERBUFFER, hitTestRboName[0]);

    GLTools.checkFramebufferStatus(gl, "ht-check");
    parent.setHitTestFboName(hitTestFboName[0]);
}
 
Example 20
Source File: Renderer.java    From jaamsim with Apache License 2.0 4 votes vote down vote up
/**
 * Create the resources for an OffscreenTarget
 */
private void populateOffscreenTarget(OffscreenTarget target) {


	int width = target.getWidth();
	int height = target.getHeight();

	sharedContext.makeCurrent();
	GL3 gl = sharedContext.getGL().getGL3(); // Just to clean up the code below

	// This does not support opengl 3, so for now we don't support off screen rendering
	if (gl == null) {
		sharedContext.release();
		return;
	}

	// Create a new frame buffer for this draw operation
	int[] temp = new int[2];
	gl.glGenFramebuffers(2, temp, 0);
	int drawFBO = temp[0];
	int blitFBO = temp[1];

	gl.glGenTextures(2, temp, 0);
	int drawTex = temp[0];
	int blitTex = temp[1];

	gl.glGenRenderbuffers(1, temp, 0);
	int depthBuf = temp[0];

	gl.glBindTexture(GL3.GL_TEXTURE_2D_MULTISAMPLE, drawTex);
	gl.glTexImage2DMultisample(GL3.GL_TEXTURE_2D_MULTISAMPLE, 4, GL2GL3.GL_RGBA8, width, height, true);

	gl.glBindRenderbuffer(GL2GL3.GL_RENDERBUFFER, depthBuf);
	gl.glRenderbufferStorageMultisample(GL2GL3.GL_RENDERBUFFER, 4, GL2GL3.GL_DEPTH_COMPONENT, width, height);

	gl.glBindFramebuffer(GL2GL3.GL_FRAMEBUFFER, drawFBO);
	gl.glFramebufferTexture2D(GL2GL3.GL_FRAMEBUFFER, GL2GL3.GL_COLOR_ATTACHMENT0, GL3.GL_TEXTURE_2D_MULTISAMPLE, drawTex, 0);

	gl.glFramebufferRenderbuffer(GL2GL3.GL_FRAMEBUFFER, GL2GL3.GL_DEPTH_ATTACHMENT, GL2GL3.GL_RENDERBUFFER, depthBuf);

	int fbStatus = gl.glCheckFramebufferStatus(GL2GL3.GL_FRAMEBUFFER);
	assert(fbStatus == GL2GL3.GL_FRAMEBUFFER_COMPLETE);

	gl.glBindTexture(GL2GL3.GL_TEXTURE_2D, blitTex);
	gl.glTexImage2D(GL2GL3.GL_TEXTURE_2D, 0, GL2GL3.GL_RGBA8, width, height,
	                0, GL2GL3.GL_RGBA, GL2GL3.GL_BYTE, null);

	gl.glBindFramebuffer(GL2GL3.GL_FRAMEBUFFER, blitFBO);
	gl.glFramebufferTexture2D(GL2GL3.GL_FRAMEBUFFER, GL2GL3.GL_COLOR_ATTACHMENT0, GL2GL3.GL_TEXTURE_2D, blitTex, 0);

	gl.glBindFramebuffer(GL2GL3.GL_FRAMEBUFFER, 0);

	target.load(drawFBO, drawTex, depthBuf, blitFBO, blitTex);

	sharedContext.release();

}