1
$\begingroup$

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?

$\endgroup$
  • 1
    $\begingroup$ 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. $\endgroup$ – Christian Rau Sep 5 '18 at 13:48
  • $\begingroup$ Given that box filters have a poor frequency response, how often are they used in production of MIP maps? $\endgroup$ – Simon F Sep 5 '18 at 14:21
  • $\begingroup$ 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. $\endgroup$ – Alan Wolfe Sep 5 '18 at 14:58
  • $\begingroup$ 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. $\endgroup$ – narthex Sep 5 '18 at 15:12
  • 1
    $\begingroup$ Well then we have just good old glGenerateMipmap with glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS) :) $\endgroup$ – narthex Sep 5 '18 at 15:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.