vpenades / SharpGLTF

glTF reader and writer for .NET Standard
MIT License
454 stars 72 forks source link

[BUG] VerifyAccessorBounds does not support component type other than FLOAT #231

Closed hu-xd closed 2 months ago

hu-xd commented 2 months ago

First: glTF Validator and BabylonJs Sandbox reports no errors for the glb model file.

Description: when Accessor has a component type other than FLOAT, for example 5121 (UNSIGNED_BYTE), which is used as RGB / RGBA for "COLOR_0", VerifyAccessorBounds will report error, then ModelRoot.Load throws.

vpenades commented 2 months ago

Do you have a model I can use for testing?

hu-xd commented 2 months ago

yes here it is a sample gltf model https://gist.github.com/hu-xd/d9c4ec6268bad598e1b92e2ca50f299e

hu-xd commented 2 months ago

Exception message: SharpGLTF.Validation.DataException: Accessor[2] memory: Value[0] is out of bounds. 255 <= 1 <= 255 (Parameter 'memory')Model generated by <> seems to be malformed; Please, check the file at https://github.khronos.org/glTF-Validator/