public static TextureCubeMap createPrefilteredEnvMap(int size, Image.Format imageFormat) {

        TextureCubeMap pem = new TextureCubeMap(size, size, imageFormat);
        pem.setMagFilter(Texture.MagFilter.Bilinear);
        pem.setMinFilter(Texture.MinFilter.Trilinear);
        pem.getImage().setColorSpace(ColorSpace.Linear);
        int nbMipMap = Math.min(6, (int) (Math.log(size) / Math.log(2)));
        CubeMapWrapper targetWrapper = new CubeMapWrapper(pem);
        targetWrapper.initMipMaps(nbMipMap);
        return pem;
    }
initialize the pem map
@param size the size of the map
@param imageFormat the format of the image
@return the initialized prefiltered env map
jme3-core/src/main/java/com/jme3/environment/util/EnvMapUtils.java