Greetings.
I have a use case where i need to watch the same point from different perspectives.
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.
Minimal sandcastle code example:
OSM Buildings bug with multiple viewers
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.
Hi @ItsManu,
Interesting. Currently, multiple cesium viewers do not share the same context or rendering resources, so I’m curious as to why one would interfere with the rendering of the other.
I don’t think I’m able to replicate the behavior you’re describing. Would you mind providing details about your system and the browser you’re using?
I tested the sandcastle link on four different systems and i’m having the same behaviour:
- Windows 10 laptop, latest chrome
- Windows 10 desktop, latest chrome
- Windows 11 desktop, latest chrome
- Windows 11 laptop, latest chrome (tested by a collegue)
It happens with both home wifi and mobile network (using tethering).
Weirdly enough, i just tested on my android 8 phone with chrome and it does work, didn’t think of trying before.
Here is a screenshot of what i’m seeing when the bug occours:
Thanks @ItsManu!
My primary machine is MacOS, on which I cannot duplicate.
This is a shot in the dark, but is the issue avoided if you put the viewer in sperate iFrames?
If you try that and are still seeing the issue, I’ll go ahead and open a bug report in GitHub.
I tried with the separate iFrames with the systems above, and everythig seems to work correctly.
Unfortunately this is not an optimal solution for my use case, because i currently syncronize the camera movement on both viewers while mantaining the perspective difference.
Doing the same using postMessage to pass data between iframes adds quite the overhead.
Thanks @ItsManu.
I’ve gone ahead and opened a bug report.
It may help if you could visit webglreport.com and take a screenshot of your results.
These are the screenshot of the webGL test you provided for my main system (windows 11 desktop, bug happens consistently at every try)