Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement support for KHR_mesh_quantization #7157

Merged
merged 4 commits into from
Nov 14, 2019
Merged

Implement support for KHR_mesh_quantization #7157

merged 4 commits into from
Nov 14, 2019

Conversation

zeux
Copy link
Contributor

@zeux zeux commented Nov 13, 2019

This change advertises support for KHR_quantized_geometry KHR_mesh_quantization
and allows to specify it as part of required extensions when loading glTF files.

The reason why the actual extension class is empty is that the extension
doesn't define any new JSON metadata, and merely allows the use of
various quantized attributes in glTF file - and as far as I can tell
Babylon.js already supports these quantized formats either by directly
using the encoded data, or by decoding it into floating-point arrays.

Extension spec: KhronosGroup/glTF#1673
Validator support: KhronosGroup/glTF-Validator#124
Example model: BrainStem.glb.zip

Note that based on prior testing, Babylon.js de-facto supports this. This change is required because the extension is non-optional and Babylon.js refuses to load files with required extensions that aren't explicitly supported.

This change advertises support for KHR_quantized_geometry and allows to
specify it as part of required extensions when loading glTF files.

The reason why the actual extension class is empty is that the extension
doesn't define any new JSON metadata, and merely allows the use of
various quantized attributes in glTF file - and as far as I can tell
Babylon.js already supports these quantized formats either by directly
using the encoded data, or by decoding it into floating-point arrays.
@deltakosh deltakosh requested a review from bghgary November 13, 2019 16:50
@zeux zeux changed the title Implement support for KHR_quantized_geometry WIP: Implement support for KHR_quantized_geometry Nov 13, 2019
Copy link
Contributor

@bghgary bghgary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good. Some minor comments. We can merge after all the naming changes, etc.

*/
public enabled: boolean;

private _loader: GLTFLoader;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to save the loader since it's only used in the constructor.

Comment on lines 28 to 31
/** @hidden */
public dispose() {
delete this._loader;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be removed once the private _loader field is removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried to remove this actually and I can't - the TypeScript compiler (iirc) requires that there's an implementation of dispose. It can be empty though, I'll fix this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, yes, the interface function is required.

const NAME = "KHR_quantized_geometry";

/**
* [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_quantized_geometry)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't verify since the spec hasn't been merged.

@zeux zeux changed the title WIP: Implement support for KHR_quantized_geometry Implement support for KHR_mesh_quantization Nov 14, 2019
@bghgary bghgary merged commit 2d204fc into BabylonJS:master Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants