Skybox textures / mip resolution

I am not exactly sure how the textures work here but here goes:

I have a skybox made of 6 jpgs at 1024 resolution. Will those textures have mip maps that reduce the quality of the skybox or will they just keep their original size?

Hi Troy,

If you created the skybox manually, the mipmaps won’t be computed automatically. You need to use cubemapgen included in the installer to do so.

Okay great! I was worried my textures would be compressed to another format that would comprimise the resolution

That being said, if you intend to use it as a IBL reflection map I think that processing the mipmaps is necessary.

@pierre, do environmental reflections use lower resolution mipmaps when the glossiness is low or does the shader compute the right level of gloss automatically?

I’m not sure what is being talked about here.

If we’re talking about a skybox which is a cube with 6 faces, the same rules as any other 3d model apply. It will be mipmapped. If you want the best filtering possible use the “sharp” filter it’ll use the best quality filtering available on the hardware, usually anisotropic filtering.

Long explanation (feel free to skip): Saying that there’s a loss of quality isnt really accurate, without mip-mapping you end up with moire and shimmering effect which is much worst than the “blurriness”. Its also usually not blurred in the sense that the mipmap selected reflects the screen resolution at the distance the textured object is displayed at. The “blur” comes from the fact that pixels in a texture dont align perfectly with the display, which of course is going to be very common in any 3d scene, anisotropic & trilinear filtering makes that a non-issue in general - at least in the sense that its objectively the best you can possibly do (short of using 64x multisampling as you’d do for an offline movie rendering).

About the IBL, the diffuse IBL is used as lookup for a light source, as such it should contain smooth intensities, that’s what processing a reflection map in CubeMapGen will do, it’ll do a cosine filter on it to produce an estimation of the incoming light at any point on a sphere.

The specular IBL is essentially a reflection map (similar to the environment channel), the gloss controls essentially the “buriness”, the maximum glossiness is akin to a perfect mirror and a glossiness of 0 is what you’d have on matte plastic (a smoosh and no discernible feature in the reflection). That uses the mipmaps to generate the blurring in real-time.

If you absolutely want to have precise mipmaps you should export your textures in DDS and make sure they contain mipmap. When I was using it (a few years ago) the NVIDIA DDS exporter DID NOT export mipmaps by default, so even if you created them they were not exported unless you selected the right option, it is very possible that it changed, but something to look out for if you care about this.

Finally, you really cannot not generate mipmaps because it is extremely bad for performance, if you have a 4K texture and dont use mipmaps the GPU cannot effectively use texture memory caches because it ends up “scanning” the whole texture memory even for things that would never need it. If you have 1pixel of a triangle that has a 4k texture without mipmaps, the whole 4K texture (64MB) has to be in the GPU’s video memory ready for the rasterizer, normally a 1pixel triangle would use a very low resolution mipmap that would be 4 to 128 bytes…

Mobile GPUs do not even allow non-mipmapped texture for that reason, so for those platforms mipmaps will always be needed, and generated if they aren’t there.

2 Likes

Fantastic explanation. The point about the moire is something I completely forgot about.

Thanks again!