Skip to main content

Physically-Based Rendering in Cesium

As discussed in our optimized octree algorithm post, a technique for subdividing massive photogrammetry models into tiles must be adaptive to the input to achieve the best performance. New modifications to the 3D tiling pipeline in Cesium Composer allow it to adaptively select a subdivision strategy at each level of a tileset’s tree.

A traditional octree subdivision method partitions a volume into octants, utilizing splitting planes for all 3 dimensions. We can also subdivide a bounding volume into 4 sections using 2 splitting planes or 2 sections using 1 splitting plane. These strategies result in different configurations of child bounding boxes, and due to variance in the shape of massive models, none of these methods is a one-size-fits-all for tiling.

The following visual shows a comparison of loading different tilesets of the same source model, the Aerometrex cellphone tower. This view of the model is useful as a case study; it requires a moderately deep traversal of the tileset tree, so it represents a typical example of the benefits of the new subdivision strategy. The left is a baseline tileset generated with our previously described optimized octree algorithm, and the right has been generated using our newer adaptive strategy. As we can see, the right image converges to a final render faster.

Aeometrex tower tiled by octree subdivision (left) and adaptive subdivision (right)

The following graphs show data captured from the above two renders. On the right, far fewer tiles are loaded, leading to fewer draw calls for a comparable visual result in much less time. Memory usage is also lower, and the reduced number of tiles shortens loading time and speeds up rendering.

Tile shape is central to these the advantages of adaptive subdivision. For typical inputs, octree subdivision can produce tiles with irregular aspect ratios. This is problematic for culling and controlling level-of-detail.

In the two images below, the camera frustrum and tile bounding volumes are rendered. On the right, the shapes of the bounding volumes allow our engine to better select the subsection of the model it needs. By contrast, the left image shows several unnecessary details being rendered, such as the trees to the “left” of the camera frustrum. The improved bounding configurations also grant us finer control over the level of detail of the tiles we render at successive distances from the camera. This can drastically affect performance by covering areas far away from the camera with a few simple tiles instead of many detailed tiles. In this view, adaptive subdivision proves particularly effective: the right render selects only 113 tiles while the left selects 231. A side by side comparison from the camera’s point of view shows that the two renders are practically identical.

Tiles selected: 231Tiles selected: 113
Triangles drawn: 1,753,789Triangles drawn: 1,082,788

These benefits scale to larger tilesets, and a 30+% win in draw calls and render time is typical for most real-world models and camera angles.

Get in touch with my colleague, Patrick Cozzi, if you have data you want us to tile.