private void bakeSpecularIBL(int mip, float roughness, Material mat, Geometry screen) throws Exception {
        mat.setFloat("Roughness", roughness);

        int mipWidth = (int) (specular.getImage().getWidth() * FastMath.pow(0.5f, mip));
        int mipHeight = (int) (specular.getImage().getHeight() * FastMath.pow(0.5f, mip));

        FrameBuffer specularbakers[] = new FrameBuffer[6];
        for (int i = 0; i < 6; i++) {
            specularbakers[i] = new FrameBuffer(mipWidth, mipHeight, 1);
            specularbakers[i].setSrgb(false);
            specularbakers[i].addColorTarget(FrameBufferTarget.newTarget(specular).level(mip).face(i));
            specularbakers[i].setMipMapsGenerationHint(false);
        }

        for (int i = 0; i < 6; i++) {
            FrameBuffer specularbaker = specularbakers[i];
            mat.setInt("FaceId", i);

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

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

            if (isTexturePulling()) {
                pull(specularbaker, specular, i);
            }

        }
        for (int i = 0; i < 6; i++) {
            specularbakers[i].dispose();
        }
    }
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