-
Notifications
You must be signed in to change notification settings - Fork 303
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
Feat/google3d tiles #2124
Feat/google3d tiles #2124
Conversation
183f629
to
fd7c586
Compare
fd7c586
to
960d517
Compare
3dc77f9
to
9d4c59b
Compare
9d4c59b
to
49a5362
Compare
5ee5ca7
to
5103ada
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job on this PR! =)
I was able to test it using my google cloud keys and your example branch. This is still "experimental" as they are critical issues (blinking, no loading of some tiles, ...) but these come from our 3D tiles implementation.
As for my comments:
- I think you should move some parts specific to b3dm outside of the gltf parser
- I question if we should follow the standard or cesium behavior
- I'm not convinced by the multiple changes in
Fetcher.js
due to this use-case being specific but I could change my mind with a little explanation =) - Some minor issues
P.S.: Before merging, could you please rewrite your commit messages + your history (notably isolate changes in Fetcher.js
, changes in b3dm/gltf parsers in their own commits)?
4028887
to
f2d6a18
Compare
I just pushed some modifications that should answer all of your comments:
@Desplandis let me know what you think :) |
f2d6a18
to
9b8011e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice changes, I did have some additional comments nonetheless but should be easy to answer. Since those are mostly aesthetics + some questions, I'll approve this PR but please answer them. =)
Only export GLTFParser and not gltfLoader and legacyGltfLoader anymore, which is a breaking change but avoids exporting two things having the same purpose. WDYT ? Should we keep it like that or also export gltfLoader and legacyGltfLoader to avoid a breaking change until the next major version?
I'm usually cautious about breaking changes, however I don't think they are used directly by anyone...
Some 3D Tiles related parts could be refactored / simplified (especially the B3dmParser) but I didn't go into much trouble here since we are seriously considering to handle 3D tiles parsing with an external lib very soon.
I held comments on that topic. x)
I wanted to add more tests on the GLTFParser but I decided to wait until #2183 is merged since I needed to load local files.
This will the object of a future PR I think!
src/Parser/B3dmParser.js
Outdated
* true, a threejs [MeshBasicMaterial](https://threejs.org/docs/index.html?q=meshbasic#api/en/materials/MeshBasicMaterial) | ||
* is set up. config.overrideMaterials can also be a threejs [Material](https://threejs.org/docs/index.html?q=material#api/en/materials/Material) | ||
* in which case it will be the material used to override. | ||
* @return {Promise} - a promise that resolves with an object containig a THREE.Scene (gltf) and a batch table (batchTable). | ||
* | ||
*/ | ||
parse(buffer, options) { | ||
const gltfUpAxis = options.gltfUpAxis; | ||
const urlBase = options.urlBase; | ||
const frustumCulled = options.frustumCulled === undefined || options.frustumCulled === null ? true : !!(options.frustumCulled); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A simpler way could be:
const frustumCulled = options.frustumCulled === undefined || options.frustumCulled === null ? true : !!(options.frustumCulled); | |
const frustumCulled = options.frustumCulled ?? true; |
Moreover, the default parameter is documented as false
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set it back to false and used a more syntetic syntax
src/Provider/3dTilesProvider.js
Outdated
}; | ||
return Fetcher.arrayBuffer(url, layer.source.networkOptions).then((result) => { | ||
if (result !== undefined) { | ||
let func; | ||
const magic = utf8Decoder.decode(new Uint8Array(result, 0, 4)); | ||
if (magic[0] === '{') { | ||
result = JSON.parse(utf8Decoder.decode(new Uint8Array(result))); | ||
const newPrefix = url.slice(0, url.lastIndexOf('/') + 1); | ||
let newPrefix = ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to assign newPrefix
since it is assigned in both branch of the following condition (or do a ternary condition).
let newPrefix = ''; | |
let newPrefix; |
src/Source/C3DTilesGoogleSource.js
Outdated
const uri = tile.content.uri.substr(tile.content.uri.indexOf('?') + 1); | ||
const sessionIds = uri.split('='); | ||
return sessionIds[1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a non-hacky way to do this with URLSearchParams
and get this value with the corresponding key (i.e. sessionId
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, done
src/Main.js
Outdated
@@ -91,7 +92,7 @@ export { default as LASParser } from 'Parser/LASParser'; | |||
export { default as ISGParser } from 'Parser/ISGParser'; | |||
export { default as GDFParser } from 'Parser/GDFParser'; | |||
export { default as GTXParser } from 'Parser/GTXParser'; | |||
export { enableDracoLoader, enableKtx2Loader, glTFLoader, legacyGLTFLoader } from 'Parser/B3dmParser'; | |||
export { default as GLTFParser, enableDracoLoader, enableKtx2Loader } from 'Parser/GLTFParser'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay with the change!
9b8011e
to
c91731d
Compare
0d9430d
to
7f1146d
Compare
319443e
to
a6f1b6e
Compare
I went back on a previous change: I keep exporting
Therefore I think it's ready to merge @Desplandis Note that I started a branch to migrate to 3d-tiles-renderer-js in which I started implementing an "itowns GltfLoader" that inherits from |
a6f1b6e
to
bacf9cc
Compare
3eee948
to
d5ae6cb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me, all comments have been resolved! =)
d5ae6cb
to
974e229
Compare
974e229
to
ceaa063
Compare
ceaa063
to
f5c3168
Compare
Description
Motivation and Context
#2099