GLTF: Write integer min/max for integer accessors#111612
Merged
Repiteo merged 1 commit intoNov 14, 2025
Merged
Conversation
This was referenced Oct 13, 2025
dec277f to
d8375a8
Compare
Member
|
Dependencies have been merged. |
d8375a8 to
23ed730
Compare
fire
approved these changes
Nov 14, 2025
Contributor
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Currently, when exporting a file from Godot with an integer accessor type, it looks like this:
{ "bufferView": 3, "componentType": 5126, "count": 24, "max": [1.0, 1.0], "min": [0.0, 0.0], "normalized": false, "type": "VEC2" }, { "bufferView": 4, "componentType": 5121, "count": 36, "max": [23.0], "min": [0.0], "normalized": false, "type": "SCALAR" }, { "bufferView": 5, "componentType": 5126, "count": 11, "max": [5.0], "min": [0.0], "normalized": false, "type": "SCALAR" }, { "bufferView": 6, "componentType": 5121, "count": 11, "max": [1.0], "min": [0.0], "normalized": false, "type": "SCALAR" }5126 means single-precision float (32-bit float), and 5121 means unsigned byte (8-bit integer). The
"max": [23.0], "min": [0.0]values are not technically wrong, since JSON just has "number", but they are misleading. This PR changes the serialization of accessors with integer data types to use integer min/max values, so it would look like this:{ "bufferView": 3, "componentType": 5126, "count": 24, "max": [1.0, 1.0], "min": [0.0, 0.0], "normalized": false, "type": "VEC2" }, { "bufferView": 4, "componentType": 5121, "count": 36, "max": [23], "min": [0], "normalized": false, "type": "SCALAR" }, { "bufferView": 5, "componentType": 5126, "count": 11, "max": [5.0], "min": [0.0], "normalized": false, "type": "SCALAR" }, { "bufferView": 6, "componentType": 5121, "count": 11, "max": [1], "min": [0], "normalized": false, "type": "SCALAR" }This helps with KHR_node_visibility, because it needs to encode accessors as unsigned byte (8-bit unsigned integers).