GLTFExporter: Add support for 4 UV channels. #26909
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Three.js now supports multiple UV channels per mesh, up to 4:
three.js/src/renderers/webgl/WebGLPrograms.js
Lines 160 to 162 in 76e1fb1
three.js/src/renderers/webgl/WebGLProgram.js
Lines 585 to 587 in 76e1fb1
The GLTFImporter supports 4 channels per mesh of UVs:
https://github.com/mrdoob/three.js/blob/dev/examples/jsm/loaders/GLTFLoader.js#L2116-L2118
But the GLTFExporter only support 2 channels per mesh:
three.js/examples/jsm/exporters/GLTFExporter.js
Lines 1647 to 1650 in 76e1fb1
This PR fixes that discrepancy.
This contribution is funded by Threekit