@Override
    public void setFrameBuffer(FrameBuffer fb) {
        if (fb == null && mainFbOverride != null) {
            fb = mainFbOverride;
        }

        if (context.boundFB == fb) {
            if (fb == null || !fb.isUpdateNeeded()) {
                return;
            }
        }

        if (!caps.contains(Caps.FrameBuffer)) {
            throw new RendererException("Framebuffer objects are not supported"
                    + " by the video hardware");
        }

        // generate mipmaps for last FB if needed
        if (context.boundFB != null && (context.boundFB.getMipMapsGenerationHint()!=null?context.boundFB.getMipMapsGenerationHint():generateMipmapsForFramebuffers)) {
            for (int i = 0; i < context.boundFB.getNumColorBuffers(); i++) {
                RenderBuffer rb = context.boundFB.getColorBuffer(i);
                Texture tex = rb.getTexture();
                if (tex != null && tex.getMinFilter().usesMipMapLevels()) {
                    try {
                        final int textureUnitIndex = 0;
                        setTexture(textureUnitIndex, rb.getTexture());
                    } catch (TextureUnitException exception) {
                        throw new RuntimeException("Renderer lacks texture units?");
                    }
                    if (tex.getType() == Texture.Type.CubeMap) {
                        glfbo.glGenerateMipmapEXT(GL.GL_TEXTURE_CUBE_MAP);
                    } else {
                        int textureType = convertTextureType(tex.getType(), tex.getImage().getMultiSamples(), rb.getFace());
                        glfbo.glGenerateMipmapEXT(textureType);
                    }
                }
            }
        }

        if (fb == null) {
            bindFrameBuffer(null);
        } else {
            if (fb.isUpdateNeeded()) {
                updateFrameBuffer(fb);
            } else {
                bindFrameBuffer(fb);
            }

            // update viewport to reflect framebuffer's resolution
            setViewPort(0, 0, fb.getWidth(), fb.getHeight());

            assert fb.getId() > 0;
            assert context.boundFBO == fb.getId();

            context.boundFB = fb;
            if (debug && caps.contains(Caps.GLDebug)) {
                if (fb.getName() != null) glext.glObjectLabel(GL3.GL_FRAMEBUFFER, fb.getId(), fb.getName());
            }
        }
    }
Copy the source buffer to the destination buffer, including both color
and depth.

@param src the source buffer (unaffected)
@param dst the destination buffer
jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java