CesiumGS / CesiumGS/cesium

Tile transforms performance hit

Open
#11,267 0 comments 0 reactions 0 assignees View on GitHub
category - 3d tiles category - memory/performance category - traversal & selection type - enhancement
Dominant language
JavaScript
Stars
15.7k
Forks
3.9k
Avg merge
4d 6h
Merged PRs (30d)
34

Description

When rendering camera flights through a detailed 3D Tileset, frame rate can suffer, with much of the CPU time taken up by tile transforms. This problem was partially addressed in https://github.com/CesiumGS/cesium/pull/11211, but it can still be an issue in full-screen views.

See this [Sandcastle of a detailed photogrammetry tileset](https://sandcastle.cesium.com/#c=bVNhb9o6FP0rFnofgkQNaYGNjVavgm5LBaSF0HVTpM04l2BIbGo7MKj477tJ6Ea3fYrjc+4591zbPTAiS6mnJI1gzrLEXnMOxgRqBZJckrACu9vF7CMXvrj1pnvPHQnPeHLc4j2v7a3Wjw+92w5F0lP0cYUkz/U/35yP9nz/ddJoDvvefhDc70bB0OL+3u+5ySiYul+WD8LvTxGfikHvdv0VxYbLaStff3m8F/4SNZZ8PwxW537w0KFng07c+mYeR37QBljO5nx3tmr3N8HTNs5uPo+20WzZbiXD+2UzrLwPZSi5ksaSjYAtaAwiYUt6ZdiHYs8JK7z47ylpmZCgw0qNPIeSEJGyGPTuTquNiEC/I3OWGKjl0IwZGLAd6DvBV68hJrHOCiVPN61IIUHx0z0NTxkYOwaJ4kMVIWh1lmOH6knrz8RwkFAjnKWgGX4TxVfkgGHKVMgtGHhysyyeLNT2g0aquQM9AdSIkJkL/+KlhrEJS9cJGISaJ16lxQfFsxw5zqnHtMUVkxd0rlXah1gDGMdtNmmn3W7XyNnFG/rWbbl516c6/nxuwL4e+idgkZDxnbB8MWYyBicfRYM2ipEcSUNmF9SqMVKZNM6Zi3i1ILjnDVyHsrAqTGii1OraOiet1175l7O0elceatmgBqMyzQGbY1sm7IszPoDxESrCXhtU8CKn3bl428iVXgSswOkV4V7Vl5+LflDChcZUJ86L3/FmEVKvp+yHSLN0wnGacrJmHG60VniVmkXSQ+lWnthai1RYsQFDWRQ5R/NjP/l1oEoGeBNz9GYD0g6EsVioHadKLq+O86BaWWZhLOKFdap59QERPAjiQG5d/T0hlQAONna+Fz2RRBWn9pK6jPDfc1F1+F4oVWqVrrG7BK5KlJD/RbpW2pIM81Nat4A3Du1NfZbhm7GUG1MmIKRbPy3tRmJDRHT5j5eJaZkxiMyzJJmIPYSVq24d+X+VHlv2N6ATtstpC/dqUG5SSrt1/P13pVUqmTH9h/JP), and click the fullscreen button in the bottom right of the Viewer.

Performance profiles are dominated by functions like `Matrix4.multiplyTransformation`, `Matrix3.getColumn`, and `OrientedBoundingBox.distanceSquaredTo`, most of which are being called from `Cesium3DTile.prototype.updateVisibility`.

![2023-05-03 14_13_41-Hello World - Cesium Sandcastle](https://user-images.githubusercontent.com/41167620/236008363-c13af1be-715a-49f9-ac27-35b7bb1f2070.jpg)

`Cesium3DTile.prototype.updateVisibility` is called for every tile in the scene, every pass of every frame. It should be sufficient to do the matrix work only once per tile per frame, and re-use the results for different passes.

Contributor guide

Open the contributing guide

Research direction

Start at Cesium3DTile.prototype.updateVisibility and profile the detailed photogrammetry Sandcastle in fullscreen, focusing on Matrix4.multiplyTransformation, Matrix3.getColumn, and OrientedBoundingBox.distanceSquaredTo. The issue suggests doing matrix work once per tile per frame and reusing it across passes; verify the change by comparing fullscreen frame-rate profiles before and after.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.