public void initTextures(ByteBuffer data, int[] filters, int[] internalFormat, int[] format, boolean clamp) {
        for (int i = 0; i < id.length; i++) {
            id[i] = glGenTextures();
        }
        for (int i = 0; i < id.length; i++) {
            glBindTexture(textureTarget, id[i]);

            glTexParameteri(textureTarget, GL_TEXTURE_MIN_FILTER, filters[i]);
            glTexParameteri(textureTarget, GL_TEXTURE_MAG_FILTER, filters[i]);

            if (clamp) {
                glTexParameteri(textureTarget, GL_TEXTURE_WRAP_S, GL_CLAMP);
                glTexParameteri(textureTarget, GL_TEXTURE_WRAP_T, GL_CLAMP);
            }

            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);
            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);

            glTexImage2D(textureTarget, 0, internalFormat[i], width, height, 0, format[i], GL_UNSIGNED_BYTE, data);
        }
    }