Skip to content

Commit 79a9be9

Browse files
committed
gltfpack: Rebalance texture quality table
The main goal of this change is to tweak the UASTC RDO curve. The initial values here have been picked for early UASTC versions that used a different RDO algorithm, and haven't been revisited since. The new table makes it so that at tq 5, we use the same defaults as basisu (q=128 for ETC1 and l=1 for UASTC RDO), and tweak the table to be in general a little more aggressive for UASTC. We use different curves before l=1 and after as the expectation is that for earlier quality levels, the size is much more important than quality. The default lambda for tq=8 is a little larger now (0.4 vs 0.3) which will result in a small size improvement and still good quality by default. There's maybe a little more room for default lambda to be higher, but eg lambda=1 does not seem practical for normal maps on a range of production assets, so we keep the curve for tq=6..10 to be more quality focused. The new table is not based on a rigorous fitting of the actual quality/size curves, but the new tool gltfbasis.py can help find a more optimal table in the future.
1 parent 68ebd47 commit 79a9be9

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

gltf/basisenc.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ struct BasisSettings
2626
};
2727

2828
static const BasisSettings kBasisSettings[10] = {
29-
{1, 1, 0, 1.5f},
30-
{1, 6, 0, 1.f},
31-
{1, 20, 1, 1.0f},
32-
{1, 50, 1, 0.75f},
33-
{1, 90, 1, 0.5f},
34-
{1, 128, 1, 0.4f},
35-
{1, 160, 1, 0.34f},
36-
{1, 192, 1, 0.29f}, // default
37-
{1, 224, 2, 0.26f},
29+
{1, 1, 0, 4.f},
30+
{1, 32, 0, 3.f},
31+
{1, 64, 1, 2.f},
32+
{1, 96, 1, 1.5f},
33+
{1, 128, 1, 1.f}, // quality arguments aligned with basisu defaults
34+
{1, 150, 1, 0.8f},
35+
{1, 170, 1, 0.6f},
36+
{1, 192, 1, 0.4f}, // gltfpack defaults
37+
{1, 224, 2, 0.2f},
3838
{1, 255, 2, 0.f},
3939
};
4040

0 commit comments

Comments
 (0)