3D Tiles artifact due to skipLevelOfDetail
- Dominant language
- JavaScript
- Stars
- 15.7k
- Forks
- 3.9k
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 34
Description
I've noticed this in various large photogrammetry 3D Tilesets, but Adam Twite from Nearmap provided a good video illustrating this problem in [this forum thread](https://groups.google.com/d/msg/cesium-dev/R1p9qL4JDio/WldqgKrTBQAJ). The artifact is that you'll see large, sharp geometry appear as the camera moves, that disappears once the view fully resolves:

This is a known artifact from the skipLevelOfDetail optimization. This overall makes streaming tilesets a lot faster, by [up to 30 to 50% according to this blog post](https://cesium.com/blog/2017/05/05/skipping-levels-of-detail/). For now you can avoid this type of artifact by turning it off in the Cesium3DTileset constructor:
```
var tileset = new Cesium.Cesium3DTileset({
url: '...',
skipLevelOfDetail: false
});
```
Or after creation by setting `tileset.skipLevelOfDetail = false`. See the [link to the docs for this property](https://cesiumjs.org/Cesium/Build/Documentation/Cesium3DTileset.html?classFilter=Cesium3DTileset#skipLevelOfDetail) for more details.
I believe this happens because a large ancestor is showing through while the required children load. @loshjawrence was looking into this at some point, here's some of his recent thoughts on the issue:
> Talked with Sean, another thing to try is get rid of zbackface/stencil commands and instead use clipping bounding boxes (ask Model for the min max vertices which it should already have) to clip out volumes where the ancestor should not render. Need to edit the fragment shader of the placeholding ancestor. Would require creating a derived command where you hijack the command of the placeholder ancestor.
> Brute force, every ancestor should be processed with the full list of _finalResolution tiles' clipping boxes, but we should ultimately shoot for ancestors taking only their descendants boxes.
Contributor guide
Research direction
Start at the Cesium3DTileset skipLevelOfDetail path and reproduce the artifact with a large photogrammetry 3D Tileset while the view resolves. Read the notes about Model clipping bounding boxes, fragment shaders, and derived commands; done means the optimization remains enabled without sharp ancestor geometry appearing through required children.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100