1

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?

Alan Wolfe
  • 7,711
  • 3
  • 29
  • 72
  • 1
    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 05 '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 05 '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 05 '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 05 '18 at 15:12
  • For the record, this has nothing to do with PBR, just regular old cube map mip maps. – Alan Wolfe Sep 05 '18 at 15:18
  • 1
    Well then we have just good old `glGenerateMipmap` with `glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS)` :) – narthex Sep 05 '18 at 15:23

0 Answers0