-
Notifications
You must be signed in to change notification settings - Fork 197
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
[Bug] "Cesium OSM Buildings" 3d tiles dataset not working with loaders.gl #3144
Comments
Yes, it looks like that the As a workaround, the visibility can be checked by simply calculating 2D intersections between tiles and view bounding box. The dataset is displayed when changing the following lines of tile-3d.ts in this._visibilityPlaneMask = this.visibility(frameState, parentVisibilityPlaneMask);
this._visible = this._visibilityPlaneMask !== CullingVolume.MASK_OUTSIDE; to const bounds = frameState.viewport.getBounds();
this._visible = !(this.boundingBox[0][0] > bounds[0] && this.boundingBox[0][1] > bounds[1]
&& this.boundingBox[1][0] < bounds[2] && this.boundingBox[1][1] < bounds[3]); |
thanks for this pointer 🤙🤙, will have a look ! |
The calculated bounding volume box from the 3D tiles region is incorrect, especially for large extents. The root tile of the OSM Buildings dataset covers nearly the global extent and the derived box is just a slice, thus no children will be loaded. I've created a codepen for testing: https://codepen.io/sraimund/pen/ByBRWZY Loaders.gl (createBoundingVolume({ region })): Cesium.js (OrientedBoundingBox.fromRectangle): Cesium has fixed this issue exactly five years ago: |
@tdurand @sraimund Thanks for raising this and for the detailed root causing and codepen
That makes some sense, as loaders.gl forked the Cesium code about 6 years ago, so we did miss some fixes. As far as I can tell, the big addition here is a new method to the oriented bounding box class, and once that is in place the remaining changes in loaders.gl will be quite small. The place to contribute the new method would be here https://github.com/visgl/math.gl/blob/master/modules/culling/src/lib/bounding-volumes/oriented-bounding-box.ts If someone puts up a PR, we will help with publishing a new version of math.gl |
For a start, I could port the code successfully to the built file 'bounding-volume.js': https://gist.github.com/sraimund/a638cf5a3eff3a75fa7f7c9bc3644128 Next, I will add TypeScript and split the code, and try to push it to math.gl. |
@sraimund math.gl changes landed and published in |
Loader
CesiumIonLoader (Tiles3DLoader)
Description
I am looking to display the OSM Buildings dataset from Cesium using deck.gl (and loaders.gl) (3D tiles data)
Unfortunately nothing displays (no buildings), after some investigation I found out that:
Loaders.gl
requests properly thetileset.json
, but do not go further downNaN
for zoom value (which may be normal as it is a worldwide dataset, not localized somewhere)When trying to debug, it seems that
loaders.gl
is not working well with this tilesetboundingVolume
, and when it checks if it should go deeper just returns without getting down to the child tiles. (some more details here)Thanks for having a look
Expected Behavior
I would expect OSM buildings to load like on this example of Cesium : https://sandcastle.cesium.com/?src=Cesium%20OSM%20Buildings.html&label=ion%20Assets
Steps to Reproduce
Minimal repro based on the loaders.gl example for 3D Tiles: https://github.com/tdurand/test-cesium-osmbuildings/blob/main/app.tsx
Deployed here: https://test-osmbuildings.vercel.app/
Environment
Logs
For reference, the root tileset.json content
No response
The text was updated successfully, but these errors were encountered: