Generating Mip Maps For A Cube Map

Let's say I have a cube map that has a resolution of 256x256 for each face and I want to generate mip maps for it using a box filter.

It's tempting to just mip each face individually, cutting the resolution of each face in half for each mip, by averaging each 2x2 group of pixels.

Doing this, information never crosses the boundary of a cube map face though, which feels like it might be incorrect.

What is the correct way to generate mips for a cube map?

• But then again, when using a box filter anyway, information never crosses the boundaries of a 2x2 block either, or 4x4, or 8x8,... That is to say, the same question stands when mipmapping a regular 2D texture applied in a repeating wraparound fashion, too. – Christian Rau Sep 5 '18 at 13:48
• Given that box filters have a poor frequency response, how often are they used in production of MIP maps? – Simon F Sep 5 '18 at 14:21
• I'ts pretty common in my experience that engines will have box filter as the default way to make mips for a texture, with other options available such as kaiser windowed sync, for times when that is more appropriate. – Alan Wolfe Sep 5 '18 at 14:58
• Fine way for me is using ggx importance sampling with varying roughness in 0 - 1 range, which depends on mip level. Then each iteration stores results in adequate mip level. – narthex Sep 5 '18 at 15:12
• Well then we have just good old glGenerateMipmap with glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS) :) – narthex Sep 5 '18 at 15:23