NVIDIA Texture Tools Exporter 2023.1.0 / Texture Tools 3.2.0 Released

I’m happy to announce the release of the NVIDIA Texture Tools Exporter 2023.1.0 and Texture Tools 3.2.0!

This post describes the new features, improvements, and bug fixes (relative to 2021.2 and 3.1.6) in the new version.

New Features and Improvements

Exporter (both plugin and standalone)

  • Adds ability to save and load settings in presets.

This makes it so that you can save the current exporter settings, then quickly re-load them when working on another image. The new preset buttons are located in the top-left of the Exporter window:

The NVIDIA Texture Tools Exporter window showing three buttons in the top-left. From left to right: Reset, Load Preset, and Save Preset.

You can also use preset files in the command line or in batch scripts:

nvtt_export.exe input.png -o output.dds --preset to_bc5_normal_map.dpf

Preset (.dpf) files are really text files, which means you can copy them between computers, generate a preset file using the standalone and load it in Photoshop, or even edit them with a text editor. Here’s an example preset file that performs normal mapping using the 5x5 kernel with a scale of 4, and enables BC5u compression: normal-map-example.dpf (174 Bytes)

The new Exporter can also read preset files created using the legacy version of the Exporter (not all features are supported, but it tries to read as many properties as it can). On the technical side, new Exporter preset files contain command lines (and preset files cannot reference other preset files, to prevent infinite recursion), and Photoshop actions also now use Exporter command lines. (Previously recorded Actions should be forwards-compatible; if you have an Action that no longer works, please let me know!)

  • Adds support for volume textures and texture arrays.

On the left, a series of z slices through a 3D lightmap. On the right, a user scrolls through the different slices in the Texture Tools Exporter

lightMap.dds from Emil Persson’s Volume Lightmapping demo.

The Exporter can now read atlases of volume slices and texture arrays arranged vertically. This works together with atlas support for cube maps and custom mipmaps (arranged horizontally), so you can create volumes with custom mips, arrays of cube maps, arrays of volumes with custom mips, and so on.

Volume and array support existed in the legacy version of the plugin, but we’ve gone a bit further with the new implementation, and have support for volumes where each slice may be rectangular.

  • Adds unsigned BC6H support. This adds up to an extra bit of precision in all three RGB components, if the input texture does not contain negative values (i.e., colors darker than pure black).

  • Adds linear-to-sRGB and sRGB-to-linear effects.

A screenshot of the sRGB To Linear effect interface.

Did a file import with the wrong color space, so it looks too bright or too dark? Now, you can fix that with a single effect! These exactly implement the sRGB transfer function and its inverse, so they’re more accurate than a gamma of 2.2 or 1/2.2.

  • Adds Ctrl-S and Ctrl-O shortcuts for Save and Open.

  • Statically links with runtime libraries to remove MSVC++ Runtime Library installation requirement.

Previously, the Exporter would not launch unless you had installed the Microsoft Visual C++ Redistributable. Now, it can run on a fresh install of Windows without anything else installed!

  • Improves premultiplication thresholds to avoid brightness shifts when mipmapping 16-bit images with small but nonzero alpha values.

Exporter Plugin

  • Canceling when overwriting a file now restores the old version of the file.

The plugin now makes backups of files before writing them, and restores them if you exit without saving. By default, these backups are created in the Windows temp directory, %LocalAppData%\Temp.

Exporter Standalone

  • Adds an Input Information pane, which displays image properties when you open a texture.

This makes it easier to analyze how images were saved! It works for all image types we support. Here’s an example from a DDS file:

DDS file with DXT10 extension. Extent: 704 x 618 x 1 px. DXGI format: ASTC_4X4_UNORM (134). Mips: 10. Array elements: 1. Cubemap: false. Alpha mode: Straight. Written by the NVIDIA Texture Tools Exporter.

Here’s an example from a KTX2 file:

KTX file, version 2. Type: 2D. Extent: 648 x 1152 px. Supercompressed using Basis UASTC. Loader transcoded to Vulkan format BC7_SRGB_BLOCK (146). Mips: 11. Is array texture: false. Faces: 1. Is premultiplied: false. Color space: sRGB. Swizzle: {R, G, B, A}. Key/value data: KTXorientation: rdi. KTXwriter: toktx v4.0.default / libktx v4.0.default. KTXwriterScParams: --uastc

And here’s an example from a PNG file:

PNG (Portable Network Graphics) file. Extent: 725 x 638. Type: Regular image. Color type: RGB. Bits per pixel: 24

  • Avoids showing console window by default when launching the GUI.

NVTT

  • Adds precompiled kernels for Hopper and Ada GPUs.

  • Adds 16-bit half float (nvtt::ValueType::FLOAT16) as an input to the low-level API.

  • Faster BC6H GPU compression.

  • Adds BC3n GPU compressor.

  • Adds nvtt::SetMessageCallback(). NVTT now reports errors, warnings, and messages through each thread’s message callback. In particular, this can be used to detect errors even when a function does not return bool.

  • Adds nvtt::Surface::gpuDataMutable(). This allows NVTT Surface data to be used with your own custom CUDA kernels, without requiring a const_cast.

  • Adds unclamped sRGB transfer functions (toSrgbUnclamped() and toLinearFromSrgbUnclamped()). These allow HDR images to be converted to sRGB and back without significant information loss.

    • Previously, these were implemented inside the Texture Tools Exporter layer; they’re now available in the NVTT library.
  • Adds toLinearFromXenonSrgb(), the inverse of toXenonSrgb().

  • Adds nvtt::nvtt_encode() and nvtt::EncodeSettings to the low-level API. nvtt_encode() unifies all low-level compression functions under a single interface, and EncodeSettings can be extended to add new features without breaking the API.

  • Adds AArch64 Linux builds.

  • x86-64 Linux builds are now compatible with an earlier version of glibc, 2.2.5. This allows it to run on CentOS 7 and Ubuntu 16.04+. Previously, x86-64 Linux builds required Ubuntu 18.04+ or a similarly compatible distro.

Bug Fixes

Exporter (both plugin and standalone)

  • Fixes a bug where the blue component of tangent-space normals used the entire [0, 1] range instead of [0.5, 1].

  • Fixes a bug where BC7 was listed twice as an export format.

  • Fixes a bug in the installer where if the selected directory didn’t exist, it would warn the user incorrectly that the selected directory already contained something.

Exporter Plugin

  • Modifies OpenGL context creation to support running inside Photoshop on laptops with certain types of integrated GPUs.

This should fix the “Creating the window with GLFW failed!” error message. It turned out that certain laptop GPUs report an OpenGL context version of 4.6 when running the standalone, but report a supported version of only 2.1 when running the Photoshop plugin. Because the Exporter requested an OpenGL version of 4.5, GLFW failed to create an OpenGL context. We fixed this in version 2023.1.0 by instead requesting an OpenGL 2.1 context, and loading other function pointers as needed.

This bug took a while to track down! Thank you to igorfak91 for the info that ultimately helped us find a system where we could reproduce this bug. The error message that can appear (“Creating the window with GLFW failed. Although the program couldn’t create a window…”) has also now been much improved, and if you launch the plugin while DebugView is active, you should see some more specific information starting with “GLFW error code”. If you see it when running the new version, please let us know at texturetools@nvidia.com or on this forum!

  • Installer searches for the most recent Photoshop installation in C:\Program Files\Adobe before looking in the registry, to fix an unexpected install location when two versions of Photoshop are present.

Exporter Standalone

  • Fixes a bug where .hdr files were clamped to [0, 1] on import.

  • Fixes a bug where calling nvtt_export with an unparseable command line would segfault.

  • Fixes a FreeImage issue where 1-component .exr files would load blank, unless that component was named “Y”.

  • Improvements to FreeImage security when loading untrusted files.

  • Interprets ICC v4 color profiles that can’t be transformed as linear RGB instead of crashing.

NVTT

  • Fixes an out-of-bounds write within the BC2 GPU compressor.

  • Fixes a bug where the C wrapper and C++ Error enumerations didn’t match.

  • Fixes a bug where the slow-mode BC1 CPU compressor would sometimes output blocks with alpha, if the input had variegated blocks with semitransparent pixels. (Thank you to tgrimmer on the NVIDIA Developer Forums.)

  • Fixes a bug where nvtt::Surface::toSrgb() turned 1.0 into 0.999999940 instead of 1.

  • Fixes a bug where nvttContextQuantize() was missing from the C wrapper symbols. (Thank you to mijalko on the NVIDIA Developer Forums.)

Many of the feature requests and bug reports came from this forum — thank you all for the excellent feedback so far! If you spot any bugs in the new version, please don’t hesitate to contact us at texturetools@nvidia.com or in this forum. Thanks again!