Skip to content
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

3DTiles streaming optimizations #7774

Merged
merged 409 commits into from
Apr 26, 2019
Merged

3DTiles streaming optimizations #7774

merged 409 commits into from
Apr 26, 2019

Conversation

loshjawrence
Copy link
Contributor

@loshjawrence loshjawrence commented Apr 24, 2019

This is for all the 3DTile streaming optimizations. Those features include:

  • Method to integrate many priority attributes into a single number for sorting. Right now those attributes are: depth, distance to camera, screen space error (SSE), foveated measurement, progressive resolution, preload flight, foveated deferral.
  • Request culling which includes canceling out-of-view requests, ignoring requests which are likely to go off screen in a short while given the camera movement, and optionally time-gating requests for foveated deferral tiles (tiles near the edge of screen).

Foveated attributes are just a measurement of how off-center the tile is. Foveated deferral is a boolean indicating that the tile is sufficiently off-center enough and fails a modified SSE test (SSE is progressively harder to meet the further off-center you go).

Progressive resolution is a boolean indicating the tile meets SSE for a smaller screen resolution. These tiles are promoted in order to prevent screen starvation (taking a while to refine really jarring LODs) for slow connections and higher resolution screens.

Camera flight destination tiles are marked as such and promoted. A second traversal is required to keep the tiles 'touched' (so they stay in cache) and keep the requests coming while the camera is in flight.

Tiles can be canceled simply by looking at one of the frame-based timestamp members and seeing if its older than the current frame. A tile-requests-in-flight container is kept so that these tiles can be reviewed every frame.

The camera movement based request culling is accomplished by comparing the magnitude of the camera movement with the physical size of the tile. A fudge factor is used to tune the comparison since the comparison is a heuristic.

The time-gating feature just holds off on foveated deferred tiles until the camera has stopped moving for a specified time. Wouldn't be hard to extend it to other types of deferral in the future, just another boolean check.

The priority integration step takes a priority attribute maps it to 0-1 number then scales it into a fixed digit range into the priority number. Min and max of the attributes are tracked (for number attributes) so that the 0-1 mapping can be done. Example (back face deferral not used in this system yet):
image

Due to the nature of some traversal types (non-skiplod + replace refine) it's better to link up priorities in those cases by having an ancestor hold certain priorities (to force a hash collision) so that the bundle of requests will be formed (sections of the family tree divided up). This allows ordering of bundles and priorities within bundles are distinguished based on an lower order attributes like tree depth.

Not really a streaming performance feature but a useful debugging feature is the tile member heatmap visualizer. You can set the heatmap var to any tile member string. The result will be a relative coloring of that member for all visible tiles. It can quickly give a sense for whats wrong or not completely correct since it's not hard to imagine what the correct result should look like. If a specific range is desired you can set that as well (want to see if tiles fall within a certain range, want to see what tiles fall outside that range, etc). Search 'heatVar' in the sandcastles for an example.
image

Tileset Time (master, preload, no preload) Loads (master, preload, no preload) Time Reductions (preload, no preload) Load Reductions (preload, no preload)
Nearmap NYC 12.6, 0.6, 9.9 677, 321, 450 95%, 21% 53%, 34%
Pharsalia 24.3, 8.9, 19.9 232, 154, 199 63%, 18% 34%, 14%
Houston 29.4, 9.5, 28.7 1012, 535, 740 68%, 2% 47%, 27%
Berlin 33.1, 18.8, 26.3 1001, 573, 662 43%, 21% 42%, 34%

@lilleyse
Copy link
Contributor

There is a stray console log somewhere that's showing up in 3D Tiles related Sandcastles.

CHANGES.md Outdated Show resolved Hide resolved

// Save the final destination view information for the PRELOAD_FLIGHT pass.
var preloadFlightCamera = this._scene.preloadFlightCamera;
if (this._mode !== SceneMode.SCENE2D) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I mentioned in a previous PR but it got pushed, this should also work for 2D.

Copy link
Contributor Author

@loshjawrence loshjawrence Apr 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a bug related to this: #7781

Source/Scene/Cesium3DTile.js Outdated Show resolved Hide resolved
Source/Scene/Cesium3DTileset.js Outdated Show resolved Hide resolved
Source/Scene/Cesium3DTileset.js Outdated Show resolved Hide resolved
Source/Scene/Cesium3DTileset.js Show resolved Hide resolved
Source/Scene/Cesium3DTileset.js Outdated Show resolved Hide resolved
Source/Scene/Cesium3DTilesetTraversal.js Outdated Show resolved Hide resolved
@lilleyse
Copy link
Contributor

@loshjawrence The latest updates look good. I just rearranged the CHANGES entries and made some other small changes.

Awesome work!

@lilleyse lilleyse merged commit ab441f2 into CesiumGS:master Apr 26, 2019
@mramato
Copy link
Contributor

mramato commented Apr 27, 2019

Just found a major showstopper #7786, we really need to put master through it's paces before Wednesday to catch anything else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants