GLTF loader with Draco extension#2
Conversation
|
|
||
| return this._withDependencies( [ | ||
|
|
||
| "accessors", |
There was a problem hiding this comment.
In loadAccessors function, is it required to check if the accessor has bufferView before this line:
var arraybuffer = dependencies.bufferViews[ accessor.bufferView ];
There was a problem hiding this comment.
Makes sense; done. We may eventually need to consider what should be returned, since the accessor cannot create a THREE.BufferAttribute in this case.
| return this._withDependencies( [ | ||
|
|
||
| "accessors", | ||
| "bufferViews", |
There was a problem hiding this comment.
From my understanding, bufferViews will be loaded when accessors are loaded. So the line is not necessary?
There was a problem hiding this comment.
Correct – bufferViews are a dependency of accessors, so they're already loaded, but must also be listed explicitly here for them to be included in the dependencies parameter.
|
|
||
| GLTFDracoMeshCompressionExtension.prototype.decodePrimitive = function ( primitive, dependencies ) { | ||
|
|
||
| var bufferViewID = primitive.extensions[ this.name ].bufferView; |
There was a problem hiding this comment.
According to the conformance, we need to use the version property to verify if the version of the encoded mesh and decoder are compatible, e.g. > 0.9.1.
@ondys
@FrankGalligan
There was a problem hiding this comment.
one problem is that our draco_decoder.js currently does not provide API to query its version. I'll try to add that today.
Another thing is that we should most likely not care about the revision version, only the major and minor versions should affect the bitstream .. i.e. we should probably mention in the spec that for conformance, the decoder needs to support the major.minor version of the encoded file, revision can be ignored (if we want to include it at all).
There was a problem hiding this comment.
Just a short update on the version (mostly for @donmccurdy) .. I'll probably land the CL internally later today, but an updated draco_decoder.js is most likely going to be available no earlier than Monday)
There was a problem hiding this comment.
Thanks @ondys! Let me know when the version is available, and get that check added.
There was a problem hiding this comment.
@donmccurdy Thanks for the remainder! The version check should be available in our latest javascripts posted in our master branch. You can check whether the provided version is supported using function DracoModule.isVersionSupported(versionString)
The only problem is that the function needs to be called from and instance of DracoModule which is in your case automatically instantiated inside the class THREE.DRACOLoader and as far as I can tell, there is currently no easy way get the module out of the loader, so we may have to either add the version check functionality to THREE.DRACOLoader or we can make the DracoModule accessible to other classes. Alternatively, you can just create a new instance of DracoModule in your code, but that would be an overkill for a simple version check (it's actually quite costly to instantiate it).
There was a problem hiding this comment.
Great! Offhand I think exposing a isVersionSupported(version) method on THREE.DracoLoader, calling through to DracoModule, sounds like the way to go. I will try to look into that more this weekend. :)
There was a problem hiding this comment.
Just sent over a PR; avoiding making another DracoModule instance seems like a good call thanks.
|
Any other issues we want to look into here? Once the version check is in, I think we could consider merging this to the three.js GLTF2Loader. |
031195e to
7f7b11b
Compare
|
I've updated this branch with the |
Docs: Added TextBufferGeometry
Docs: correct refraction ratio definition
6ca99b7 to
bad6b18
Compare
bad6b18 to
0f8069b
Compare
* Implement GLTFDracoMeshCompressionExtension. * Add DracoBunny.gltf example. * Clean up default material situation. * Add extensionsRequired. * Ignore accessors w/o bufferView. * fix * Updated gltf draco sample bunny * Fix * removed test files * Remove bad merge * Remove bad merge * Fix * Fix * Fix * Fix * Fix
913ff6f to
7e834ad
Compare
7e834ad to
4113305
Compare
* fix standing matrix application * demonstrate setPoseTarget * update build
(DO NOT Merge. It's for discussion only)
Hi @donmccurdy,
Thank you so much for the great work. We can discuss here for the detail.
@ondys
@FrankGalligan