@Override
    public void simpleInitApp() {
        int w = settings.getWidth();
        int h = settings.getHeight();

        //setup framebuffer
        fb = new FrameBuffer(w, h, 1);

        Texture2D fbTex = new Texture2D(w, h, Format.RGBA8);
        fb.setDepthTarget(FrameBufferTarget.newTarget(Format.Depth));
        fb.addColorTarget(FrameBufferTarget.newTarget(fbTex));

        // setup framebuffer's scene
        Sphere sphMesh = new Sphere(20, 20, 1);
        Material solidColor = assetManager.loadMaterial("Common/Materials/RedColor.j3m");

        Geometry sphere = new Geometry("sphere", sphMesh);
        sphere.setMaterial(solidColor);
        fbNode.attachChild(sphere);

        //setup main scene
        Picture p = new Picture("Picture");
        p.setPosition(0, 0);
        p.setWidth(w);
        p.setHeight(h);
        p.setTexture(assetManager, fbTex, false);

        rootNode.attachChild(p);
    }
Demonstrates FrameBuffer usage.
The scene is first rendered to an FB with a texture attached,
the texture is then rendered onto the screen in ortho mode.

@author Kirill
jme3-examples/src/main/java/jme3test/post/TestFBOPassthrough.java