Number of depth slices appears to half per mip level

Hi, as illustrated below, when the input texture is a volume texture, NVTT seems to half the number of depth levels per mip level. This is a problem because our shaders assume that the depth is constant per mip level (as well as our dds importer).

Thanks!

Hi @jesse.r.meyer ! This is correct; a volume texture should decrease in width, height, and depth by a factor of 2 for each mip. See for instance DDS Volume Texture Example - Win32 apps | Microsoft Learn or Volume Texture Resources (Direct3D 9) - Win32 apps | Microsoft Learn .

You probably want to store the individual frames of your caustics/Voronoi animation as array elements instead of volume slices – if you swap 128 and 1 in “Depth of Volume in Atlas” and “Number of Array Elements”, that should do the trick. Note that in your shader you’ll need to manually interpolate between two array elements using two explicit samples instead of relying on 3D texture interpolation, but that should be equivalent performance (and closer to what you want, since animated textures when viewed from far away shouldn’t blur across time).

Let me know if that works!

1 Like

Most helpful, thanks for the insight!