vpenades / SharpGLTF

glTF reader and writer for .NET Standard
MIT License
467 stars 75 forks source link

KHR_mesh_quantization? #67

Closed bertt closed 4 years ago

bertt commented 4 years ago

Hi, I'm trying to read glTF's with KHR_mesh_quantization, is this already supported or not? At the moment I observe the following exception:

Unhandled exception. SharpGLTF.Validation.LinkException: ModelRoot Extensions: KHR_mesh_quantization
   at SharpGLTF.IO.ReadContext.ReadBinarySchema2(Stream stream)
   at SharpGLTF.Schema2.ModelRoot.ReadGLB(Stream stream, ReadSettings settings)
vpenades commented 4 years ago

Hmmm.... Unless I've missed something, it's supported for reading glTF files.

In fact, in the Khronos test files there's a few quantized models, and are successfully loaded by the tests.

KHR_mesh_quantization is a bit weird extension because other than appearing in the "required extensions", it does not add anything to the schema. In fact it's only effect is lifting the enconding restrictions for the vertex attributes, which was available since the very beginning.

Anyway, could you share the model that's giving you errors?

Update: right, I've checked again and it seems the tests were not running through the quantized models... so there's a bug

vpenades commented 4 years ago

I have upload some changes, let me know if you can test it.

bertt commented 4 years ago

ok thanks! I did a quick (n=1) test, can read the glTF with KHR_mesh_quantization now successfully.