@Override
    public void render(final RenderManager renderManager) {
        if (isBusy()) {
            final SnapshotJob job = jobs.get(0);

            for (int i = 0; i < 6; i++) {
                viewports[i].clearScenes();
                viewports[i].attachScene(job.scene);
                renderManager.renderViewPort(viewports[i], 0.16f);
                buffers[i] = BufferUtils.createByteBuffer(
                        size * size * imageFormat.getBitsPerPixel() / 8);
                renderManager.getRenderer().readFrameBufferWithFormat(
                        framebuffers[i], buffers[i], imageFormat);
                images[i] = new Image(imageFormat, size, size, buffers[i],
                        ColorSpace.Linear);
                MipMapGenerator.generateMipMaps(images[i]);
            }

            final TextureCubeMap map = EnvMapUtils.makeCubeMap(images[0],
                    images[1], images[2], images[3], images[4], images[5],
                    imageFormat);
            debugEnv = map;
            job.callback.done(map);
            map.getImage().dispose();
            jobs.remove(0);
        }
    }
Takes a snapshot of the surrounding scene.

@param scene the scene to snapshot.
@param done a callback to call when the snapshot is done.
jme3-core/src/main/java/com/jme3/environment/EnvironmentCamera.java