Generate set amount of mipmaps

Hi,

Is there a way to generate only a set amount of mipmaps?
For example for a 512x512 texture I want to generate 8 mipmaps. But the tool generates 10 mipmaps
For 1024x1024 where I want to have 9 mipmaps it generates 11.
Like it always add 2 extra ones to the amount of mipmaps.

Cheers

Yes, please add this option, or explain how to create required number in the new version.

Hi @jkarwacki99 and @zifriton!

We just released NVTT Exporter 2024.1.0, which includes two new options: “Minimum Mipmap Size” and “Maximum Mipmap Count”.

image

These both allow you to control the number of mips generated, but in slightly different ways. “Minimum Mipmap Size” helps support the most common case – when you’re working with an API that only allows images whose width and height are divisible by the block size (4 px for every block-compressed format except ASTC). It makes the Exporter stop the mip chain before it generates a mip whose width or height is less than the given size. So, for instance, if you’re working with power-of-two textures, you can set this to 4 px; then the Exporter will only generate mips whose width and height are greater than or equal to 4. (It always generates the base mip, so if your input texture is 1x1, you’ll still have issues. One option is to also add the new Resize effect in the “Fit If Smaller” mode!)

“Maximum Mipmap Count” explicitly controls the maximum number of mipmaps generated. So, for instance, if you only want to generate mips 0, 1, 2, 3, and 4, you can set it to 5. Its default is MAX, which generates a full mip chain.

These are also accessible on the command line via the --min-mip-size and --max-mip-count options.

Thanks again for the feature request!

2 Likes

Thank you for your work and for being attentive to users feedback. It’s greatly appreciated!

1 Like