@Override
    public void bakeSpecularIBL() {
        Box boxm = new Box(1, 1, 1);
        Geometry screen = new Geometry("BakeBox", boxm);

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

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

        int mip = 0;
        for (; mip < specular.getImage().getMipMapSizes().length; mip++) {
            try {
                float roughness = (float) mip / (float) (specular.getImage().getMipMapSizes().length - 1);
                bakeSpecularIBL(mip, roughness, mat, screen);
            } catch (Exception e) {
                LOGGER.log(Level.WARNING, "Error while computing mip level " + mip, e);
                break;
            }
        }

        if (mip < specular.getImage().getMipMapSizes().length) {

            int[] sizes = specular.getImage().getMipMapSizes();
            sizes = Arrays.copyOf(sizes, mip);
            specular.getImage().setMipMapSizes(sizes);
            specular.getImage().setMipmapsGenerated(true);
            if (sizes.length <= 1) {
                try {
                    LOGGER.log(Level.WARNING, "Workaround driver BUG: only one mip level available, regenerate it with higher roughness (shiny fix)");
                    bakeSpecularIBL(0, 1f, mat, screen);
                } catch (Exception e) {
                    LOGGER.log(Level.FINE, "Error while recomputing mip level 0", e);
                }
            }
        }

        if (isTexturePulling()) {
            endPulling(specular);
        }
        specular.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)
jme3-core/src/main/java/com/jme3/environment/baker/IBLHybridEnvBakerLight.java