@Override
    public void bakeIrradiance() {

        Box boxm = new Box(1, 1, 1);
        Geometry screen = new Geometry("BakeBox", boxm);

        FrameBuffer irradiancebaker = new FrameBuffer(irradiance.getImage().getWidth(), irradiance.getImage().getHeight(), 1);
        irradiancebaker.setSrgb(false);

        if (isTexturePulling()) {
            startPulling();
        }

        for (int i = 0; i < 6; i++) {
            irradiancebaker.addColorTarget(
                    FrameBufferTarget.newTarget(irradiance).face(TextureCubeMap.Face.values()[i]));
        }

        Material mat = new Material(assetManager, "Common/IBL/IBLKernels.j3md");
        mat.setBoolean("UseIrradiance", true);
        mat.setTexture("EnvMap", envMap);
        screen.setMaterial(mat);

        for (int i = 0; i < 6; i++) {
            irradiancebaker.setTargetIndex(i);

            mat.setInt("FaceId", i);

            screen.updateLogicalState(0);
            screen.updateGeometricState();

            renderManager.setCamera(updateAndGetInternalCamera(i, irradiancebaker.getWidth(), irradiancebaker.getHeight(), Vector3f.ZERO, 1, 1000), false);
            renderManager.getRenderer().setFrameBuffer(irradiancebaker);
            renderManager.renderGeometry(screen);

            if (isTexturePulling()) {
                pull(irradiancebaker, irradiance, i);
            }
        }

        irradiancebaker.dispose();

        if (isTexturePulling()) {
            endPulling(irradiance);
        }
        irradiance.getImage().clearUpdateNeeded();

    }
Create a new IBL env baker
@param rm The render manager used to render the env scene
@param am The asset manager used to load the baking shaders
@param format  The format of the color buffers
@param depthFormat The format of the depth buffers
@param env_size The size in pixels of the output environment cube map (eg. 1024)
@param specular_size The size in pixels of the output specular cube map (eg. 1024)
@param irradiance_size The size in pixels of the output irradiance cube map (eg. 512)
@param brtf_size The size in pixels of the output brtf map (eg. 512)
jme3-core/src/main/java/com/jme3/environment/baker/IBLGLEnvBaker.java