OSM Buildings broken with multiple viewers
Originally reported on the forum.
If i create two viewers on the same page and add Osm Buildings to both of them, lots of the building’s polygons get stretched and misplaced, creating a “blob” that covers the entire map.
Notes:
- If you comment out either one of the viewXX.scene.primitives.add(await Cesium.createOsmBuildingsAsync()); lines, the other viewer works perfectly fine.
- Sometimes, the bug occours on only one of the two viewers, but it never happened to me that both viewers work fine at the same time.
- I got a similar bug on an old version of cesium when loading OSM Buildings twice in the same viewer, but i can’t manage reproduce consistently.
Also reported in https://github.com/CesiumGS/cesium/issues/11606
In #11341 I ran into this when making a Sandcastle.
I determined that it has to do with the CESIUM_primitive_outline extension (which does modify the index buffer). It seems like applying the outlines to the first copy of the tileset messes up the indices for the second copy.
See This Sandcastle
with enableShowOutlines: true on the first tileset copy (messy geometry):
with enableShowOutlines: false on the second tileset copy (no artifacts):