public void initMipMaps(int nbMipMaps) {
        int maxMipMap = (int) (Math.log(image.getWidth()) / Math.log(2) + 1);
        if (nbMipMaps > maxMipMap) {
            throw new IllegalArgumentException("Max mip map number for a " + image.getWidth() + "x" + image.getHeight() + " cube map is " + maxMipMap);
        }

        sizes = new int[nbMipMaps];

        int totalSize = 0;
        for (int i = 0; i < nbMipMaps; i++) {
            int size = (int) pow(2, maxMipMap - 1 - i);
            sizes[i] = size * size * image.getFormat().getBitsPerPixel() / 8;
            totalSize += sizes[i];
        }
        
        image.setMipMapSizes(sizes);        
        image.getData().clear();
        for (int i = 0; i < 6; i++) {
            image.addData(BufferUtils.createByteBuffer(totalSize));
        }
        mipMapRaster = new MipMapImageRaster(image, 0);        
    }
Inits the mip maps of a cube map with the given number of mip maps
@param nbMipMaps the number of mip maps to initialize
jme3-core/src/main/java/com/jme3/environment/util/CubeMapWrapper.java