-
Notifications
You must be signed in to change notification settings - Fork 193
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
Refactor 3d tile traversal - Part 1 #540
Conversation
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.
Just some initial comments, ignore if they don't make sense. I probably haven't understood all the ideas in this PR yet.
Regarding the example name, the idea is one subfolder per 3D framework: examples/i3s/deck.gl/app.js
-> examples/deck.gl/i3s/app.js
|
||
this._memWidget = new StatsWidget(lumaStats.get('Memory Usage'), { | ||
framesPerUpdate: 1, | ||
formatters: { |
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.
Any chance of getting the default formatters registered in luma.gl? This verbose code is now in more and more examples...
This is a great timing, now that luma.gl is making a major release version so no fear of accidentally breaking apps.
@@ -108,17 +130,36 @@ export default class App extends PureComponent { | |||
]; | |||
} | |||
|
|||
_renderStats() { | |||
// TODO - too verbose, get more default styling from stats widget? |
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.
Nit: Any chance to get this merged back as defaults into probe.gl, this verbose code is now in more and more examples...
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.
Follow up PR.
@@ -0,0 +1,98 @@ | |||
import {Vector3} from 'math.gl'; | |||
import {CullingVolume, Plane} from '@math.gl/culling'; |
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.
Q: Is this different from the Tile3DLayer
? If so can we do any processing inside the loaders so they don't have to be different?
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.
the example folder is temporary. Will merge i3s-3d-layer
with tile-3d-layer
in follow-up PR
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.
this is a temp change, to test i3s loading and rendering, will be removed and merged with 3d-tiles in followups.
@@ -4,12 +4,12 @@ import {Vector3} from 'math.gl'; | |||
import {COORDINATE_SYSTEM, CompositeLayer} from '@deck.gl/core'; | |||
import {SimpleMeshLayer} from '@deck.gl/mesh-layers'; | |||
|
|||
import {I3STileset} from '@loaders.gl/i3s'; | |||
import {I3STileset3D} from '@loaders.gl/i3s'; |
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.
Q: Is the plan to merge this tileset class with the other one?
We can e.g. create a @loaders.gl/category-3d-tiles
if we need a common place.
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.
Does 3d-tiles
cover both cesium 3d-tiles
and i3s
?
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.
Does
3d-tiles
cover both cesium 3d-tiles and i3s?
Assuming you mean the @loaders.gl/3d-tiles
npm module, I am open to making a change here, and have it include multiple formats.
- A strong reason to join them would be to avoid inefficiency / overhead of having so many npm modules).
- A reason to keep them separate could be to make it easier for the various partners that help us maintain the different standards to make changes to their module without being affected by other modules. But since we are sharing traversal code anyway I am not sure this really helps.
If joining the modules, some considerations would be:
- We do want a clear distinction between code that implements a certain tiled format (subdirectories for
./3d-tiles/
,./i3s/
,./potree/
etc). This would contain the various file format loaders, but also format specific things like styling support etc. - Clearly documented
./common/
code that is shared between formats (traversal/caching/request scheduling etc).
Of course we should also consider the opinions of contributors, e.g. if @loshjawrence would have concerns about a single module setup covering all tiled formats.
// For traditional replacement refinement only refine if all children are loaded. | ||
// Empty tiles are exempt since it looks better if children stream in as they are loaded to fill the empty space. | ||
const checkRefines = | ||
!skipLevelOfDetail && tile.refine === TILE3D_REFINEMENT.REPLACE && tile.hasRenderContent; |
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.
Consider removing references to skipLevelOfDetail
in this pr or part 2 since we would need to have loaders generate gpu commands so that it would look ok during loading.
get hasChildren() { | ||
// this.children are Tile3DHeader objects with content fetched from server | ||
// this._header.children are children of this tile which are not yet fetched | ||
return this.children.length > 0 || (this._header.children && this.children.length > 0); |
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.
Can this just be return this.children.length > 0;
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.
it cannot work well with i3s tiles, the i3s tile doesn't include the tree structure in tileset, so loaders.gl needs to keep fetching each unfetched tile node during the traversal. So if an i3s tile node is already fetched tile._header.children
will indicate if this tile has children or not. If loaders.gl continue fetching this tile's children, then whenever the child node is fetched, it will be constructed as Tile3DHeader object and added to tile.children.
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.
Maybe explain this in comment?
@@ -52,10 +52,19 @@ export default class RequestScheduler { | |||
return Promise.resolve(handle); | |||
} | |||
|
|||
// dedupe | |||
const existingReq = this.requestQueue.find(req => req.handle === handle); |
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.
[WIP] use 3d-tiles traversal Refactor 3d tile traversal remove unused code address comments address comments add debugging console Dedupe tile requests enable debuggging Cleanup 3d-tiles traversal [WIP] use 3d-tiles traversal Refactor 3d tile traversal remove unused code address comments address comments add debugging console Use smaller bounding sphere Dedupe tile requests enable debuggging Add more examples Add stack dedupe and cancel frame update
Will do followup PR to address comments |
This PR is the first step of refactoring the 3d-tiles traversal. Added a base traversal class (
base-tileset-traverser.js
) which could be shared by both Cesium's 3d-tiles and ArcGIS's i3s tiles traversal.The example app
examples/i3s/deck.gl/
is for testing purpose. Eventually these should be merged with 3d-tiles exampleexamples/deck.gl/3d-tiles
Next steps: