-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Gltf 2.0 #4808
Gltf 2.0 #4808
Conversation
glTF 1.0.1 Adds support for normalized vertex arrays and a test
…into gltf-1.0.1-remove-scissor-test
…cissor-test glTF 1.0.1 remove scissor test
…extensions-1.0.1 Test glTF for required extensions.
…to gltf-1.0.1-uint32-indices
Merge master into gltf 1.0.1
…/cesium into gltf-1.0.1-uint32-indices
…ndices glTF 1.0.1 uint32 indices
@mramato if you have time I could use some advice on something here. With the current way the Cesium build process works, all of the individual gltf-pipeline functions we are using here are placed onto the global Cesium scope. I suspect that isn't what we want in the end; something like I did try creating a wrapper Is there a fairly straightforward to do this with the existing build structure, or am I going to have to add this as a special case? |
@cx20 It could make sense to "mirror" the directory structure of the official sample models in your repo, or (maybe even better: ) include the official sample models as a Git submodule. (Requires users to check out with |
We don't normally filter things like because being on the Cesium object isn't really a big deal. Is there a specific motivation for this? The short version is that As an aside, I've been meaning to wrap my head around what you guys are trying to do for a while, but haven't had a chance to investigate. Can you verify my recap here is correct:
Is that correct? If so, my one question is, why not just have a simple build that outputs a single JS file that directly incorporates the parts of Cesium it needs. This avoids the need for maintaining copies of anything and the only cost is a few kb of duplicate code (assuming gltf-pipeline use of Cesium is small). The whole thing could be automated at build time. That being said, I'm okay with trying to win the battle and not the war, I just want to make sure I have a good understanding of what's going on architecturally. |
Just that these aren't really Cesium functions and it might be confusing to have them as part of the Cesium global scope.
There are no copies, we rely on the Cesium node module in gltf-pipeline. This is kind of what I had tried to do originally. The tl;dr for that is that CommonJS bundling methods like Browserify and Webpack aren't smart enough to optimize something like: var Cesium = require('cesium');
var Cartesian3 = Cesium.Cartesian3; such that only RollUp and Webpack can do tree-shaking with ES6 import syntax: import Cartesian3 from Cesium; Long-term, that might be the most correct answer, but for right now there is too much work involved in going AMD -> CommonJS -> ES6 reliably. The route I took here is to take the gltf-pipeline functions we need and amdify them, resolving out things like |
Also @pjcozzi , all |
Closing - all this work is incorporated in #5641 |
This PR is for initial review/testing, and for me to track progress.
Tasklist:
Add back model caching supportRe-enable releasing the glTFFix tests (caching support should mostly fix this)Testing TODO
Optional:
Unified loadGltfUris that works for pipeline and Cesium?As this stands, glTF 0.8 and 1.0 models will be updated to 2.0 automatically on load and 2.0 models should work as they are.
This includes some restructuring of how resources are loaded by Model. It has been updated to use promises instead of callbacks and statistics. In order to updateVersion (and processModelMaterialsCommon), buffers and shaders need to be loaded, so the loading of external resources needed to be made a bit more structured. Textures are still streamed incrementally if that is enabled.This now uses the the previous method of loading resources.This is ready for a look.