Hello!
I was playing a bit with the options in the GUI tool and found some nice effects that have the desired impact on my normal map (running “contrast more” over the image twice - which for me works much better than “scale” for example):
Sadly I seem to be unable to find this in the command line tool nvtt_export, it’s not documented in nvtt_export --help.
Hi @limesim! There is a way to do this, but it’s hidden (because the raw string involved is not easily human-writable - more on that shortly). Here’s how to do it.
Set up your effect chain and other settings. Then click the “Save Preset” button and save the current settings to a file.
Now, open your preset file in a text editor. The contents of a preset file look like this – this is in fact a command line (without input or output files)!
--format bc7 --quality normal --mips --mip-filter box --zcmp 5 --to-normal --normal-filter dudv --normal-scale 1 --height average --normal-alpha unchanged --serialized-effects-v1 "2 4 4 4 4 "
At the very end of this string, you’ll see an option like --serialized-effects-v1 "2 4 4 4 4 "
. This --serialized-effects-v1
option contains the effects stack in a text format, and “2 4 4 4 4” is the code for applying two Contrast More effects, one after the other.
This works with the regular command line – here’s how to apply two Contrast More effects, turn the result into a normal map, and save the result as a BC7-compressed DDS file:
nvtt_export.exe input.png -o output.dds --format bc7 --to-normal --serialized-effects-v1 "2 4 4 4 4"
I’m hoping to make this option use a human-readable and -writable syntax in the future, rather than a string of numbers – that’s why the option’s currently hidden (I believe it’s the only command-line option that does not appear in nvtt_export --help
) and why the best method to write these at the moment is to have the Preset system do it for you (especially since these “v1” strings can get hard to read - e.g. the string for Edge Pad followed by x2 Super-Res followed by a 2D Convolution sharpening filter is 3 21 0 18 2 0 0 0 0 0 0 0 0 0 -0.1 0 0 0 -0.1 1 -0.1 0 0 0 -0.1 0 0 0 0 0 0 0 0 0.6
)
Hope this helps!
–Neil
Fantastic and thank you very much! This will make converting a larger bunch of textures much easier and results look stunning.