Repository navigation
Commit f5c3dc2
committed
gltfpack: Fix UV quantization when material uses texture transforms
Because UVs are stored in a quantized form by default, we need to first
apply the dequantization transform and only then apply the original
texture transform. Our logic was the opposite, and only worked if
quantization offset was 0 or if texture transform was offset-only.
Note that this relies on the original transform being TRS; if the
original transform was TSR, then applying a second non-uniform scale
like so: TSR * TS would introduce skew and the resulting matrix will not
be decomposable.
Currently, three.js is using incorrect order (TSR), but Babylon.js and
PlayCanvas correctly implement glTF specification using TRS.1 parent 31687ce commit f5c3dc2
1 file changed
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
195 | 196 | | |
196 | 197 | | |
197 | 198 | | |
198 | | - | |
199 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
200 | 204 | | |
201 | 205 | | |
202 | 206 | | |
| |||
0 commit comments