Tile transforms performance hit
- 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`.

`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
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