Comments (3)
Directions from #496
We'd need a separate error metric on the tile that scales based based on distance to the center of the screen so it can be used to sort the tiles in the download and parse queue "priority callback". Adding something like a "load order" visualization to the DebugTilesRenderer would be helpful for understanding the impact of this kind of change, as well
Dropping some notes around an implementation for potentially drafting a PR
priorityCallback
TilesRendererBase priorityCallback :
3DTilesRendererJS/src/base/TilesRendererBase.js
Lines 14 to 46 in 70c3268
Could add something like this as a final check, but the if/else cascade might mean some tests are never tested against.
} else if ( a.__distanceFromScreenCenter !== b.__distanceFromScreenCenter ) {
// and finally tiles closest to the center should be prioritized for faster foveated rendering.
return a.__distanceFromScreenCenter > b.__distanceFromScreenCenter ? - 1 : 1;
}
Would that make sense to have some hard tests which return +1/-1 like originally, but hten the final tests would return a sum of +1/-1? Something like
if ( a.__depth !== b.__depth ) { ... }
else if ( a.__inFrustum !== b.__inFrustum ) { ... }
else if ( a.__used !== b.__used ) { ... }
else if ( a.__error !== b.__error )
else if (test) {
return (a.__distanceFromCamera > b.__distanceFromCamera) + (a.__distanceFromScreenCenter > b.__distanceFromScreenCenter)
}
Compute __distanceFromScreenCenter
Where to compute this __distanceFromScreenCenter
? Should be done in the traverseFunction file, right? Somewhere like
or probably better, within
Where we could compute the __distanceFromScreenCenter similar to the way the
3DTilesRendererJS/src/three/TilesRenderer.js
Line 902 in 70c3268
It would probably make sense to simply compute the distance of the tile boundingVolume center, projected onto the screen, and measure that distance to the screen center - rather than for example computing the tile bounding volume projection surface onto the screen, and decide that that metric should be the distance between that projection area and the screen center.
DebugTilesRenderer load order" viz
Probably exactly along the lines of
3DTilesRendererJS/src/three/DebugTilesRenderer.js
Lines 333 to 341 in 70c3268
from 3dtilesrendererjs.
Could add something like this as a final check, but the if/else cascade might mean some tests are never tested against.
This is ok and it's already the case that most of the time the final conditions are not used.
} else if ( a.__distanceFromScreenCenter !== b.__distanceFromScreenCenter ) { // and finally tiles closest to the center should be prioritized for faster foveated rendering. return a.__distanceFromScreenCenter > b.__distanceFromScreenCenter ? - 1 : 1; }
We should compute some adjustment of screenspace error here based distance to the center so high error tiles are still prioritized - just less so if they're off on the edge of the screen. As just an example, something like screenSpaceError + screenSpaceError * distanceToCenter * 1e-2
. This deserves more thought, though. Cesium's implementation might be the approach to reference here.
from 3dtilesrendererjs.
This is how the cesiumjs codebase merges into a single priority metric different priorities: They store it on a base10 number which is composed of (from the Cesium3DTile.js code):
preloadFlightDigits(1) | foveatedDeferDigits(1) | foveatedDigits(4) | preloadProgressiveResolutionDigits(1) | preferredSortingDigits(4) . depthDigits(the decimal digits)
It uses two priorities for the foveated rendering, a boolean priorityDeferred
(false within the cone, true outside) and a float normalizedFoveatedFactor
which is is the actual priority :
The most interesting bit are probably within the function isPriorityDeferred shows that actually, within a cone with radius given in screen space, tiles loading is not deferred, and then linearly increases between that cone limit and the screen limit.
PS: interesting note in the Cesium3DTilesetBaseTraversal.js file
An ancestor will hold the _foveatedFactor and _distanceToCamera for descendants between itself and its highest priority descendant. Siblings of a min children along the way use this ancestor as their priority holder as well.
Priority of all tiles that refer to the _foveatedFactor and _distanceToCamera stored in the common ancestor will be differentiated based on their _depth.
Plus all the foveated parameters on the Cesium3DTileset docs are interesting to understand how it's working under the hood.
from 3dtilesrendererjs.
Related Issues (20)
- Why only load JSON without loading any model files? HOT 8
- Aborted tiles leave remaining ImageBitmaps HOT 2
- GlobeControls: There's a big jump in speed at zoom out transition
- Remove callback assignments in favor of event listeners
- Remove gated logic behind r165
- Loaders: Change "load" to "loadAsync" to align with three.js api
- If loading a large model, will it use web work acceleration? HOT 1
- Move loaders to "loaders" folder
- EnvironmentControls: Clicking outside the click range can cause the camera to "jump" to a far position
- there is no BatchTable attribute for PNTS HOT 1
- The issue with testing by Jest HOT 1
- Bug: DOMException: signal is aborted without reason HOT 2
- GlobeControls: Hovering over the sky and zooming in zooms the camera forward instead of to mouse position
- GoogleTilesRenderer get all needed tiles loaded status HOT 1
- Remote textures cannot be loaded HOT 1
- EnvironmentControls: Width adjustHeight = false, maxAltitude is not respected
- EnvironmentControls: When the camera is underneath a model clicking does not work
- StructuralMetadata: Clean up code
- StructuralMetadata: Validate all fields from test data
- StructuralMetadata & MeshFeatures: Add more complete demo
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from 3dtilesrendererjs.