Domanda

If we generate mipmaps for a texture using GL_GENERATE_MIPMAP (or glGenerateMipmap), how big can the original texture be? Is it the size returned by GL_MAX_TEXTURE_SIZE, or half of it?

È stato utile?

Soluzione

From OpenGL specs:

the maximum allowable width of a texel array for a one- or two-dimensional, one- or two-dimensional array, two-dimensional multisample, or two-dimensional multisample array texture, and the maximum allowable height of a two-dimensional, two-dimensional array, two-dimensional multisample, or two dimensional multisample array texture, must be at least 2^(k-lod) + 2bt for image arrays of level 0 through k, where k is the log base 2 of MAX_TEXTURE_SIZE.

This means that max size depends on mip level number you want, actually it also depends on format if you want something like RGBA16 you might end with half the size from what constant suggests.

In reality this value is not trustworthy.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top