Sharing scene data between multiple viewers

678 views
Skip to first unread message

Sergio Flores

unread,
Mar 27, 2015, 1:14:26 PM3/27/15
to cesiu...@googlegroups.com
I need to share all scene data (primitives, data sources etc) with multiple cesium viewers/canvas.
The only difference between them would be the cameras (they would show the same content but using different view points).

Does Cesium currently supports this?
I checked the Viewer constructor and methods, but it noes not allow to change the 'scene'.

Matthew Amato

unread,
Mar 27, 2015, 1:37:23 PM3/27/15
to cesiu...@googlegroups.com
Cesium doesn't currently support it.  A big part of the problem is that WebGL does not currently have the ability to share data across contexts, which would be needed to share primitive and texture information.  I believe WebGL 2, which is in development, will address many of these issues and open the door for us to support it (but even then is going to take a lot of work on our side).

For now, the only way to do what you want is to load the same data in both Viewers, which will work, but is obviously not optimal.  You might be able to re-use the same DataSource and Entity instances, but I haven't tried it.


--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sergio Flores

unread,
Mar 27, 2015, 1:42:27 PM3/27/15
to cesiu...@googlegroups.com
I'll try sharing the data sources, but does this means I'll have to careful manage the primitives?

For example, when I create a primitive, then I'll have to add it manually to all viewers, and same thing when deleting it, basically keeping my own list outside Cesium?

Matthew Amato

unread,
Mar 27, 2015, 2:37:57 PM3/27/15
to cesiu...@googlegroups.com
It's more than that. You can't share primitives at all, you will need to create two copies of each primitive, one for each viewer and mange them that way.

I'm not event 100% sure you can share data sources either, but I think it will work.

Sergio Flores

unread,
Mar 27, 2015, 2:44:05 PM3/27/15
to cesiu...@googlegroups.com
Yes, that was what I meant, I just worded it wrong, I mean adding duplicates of primitives, one duplicate per viewer.
I'll look better into changing our code base to support this.

--
You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cesium-dev/rsoFNBslEDE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cesium-dev+...@googlegroups.com.

ene...@seas.upenn.edu

unread,
Jul 19, 2017, 9:34:02 AM7/19/17
to cesium-dev, rel...@gmail.com
Since this was a while ago, has any of this changed? Is it now possible to share data across viewers? Specifically, it would be nice to create an entity and add it to multiple viewers and do the same for 3D Tiles tilesets. Currently, I'm trying to do this with an entity and it doesn't seem to be working but I may not be doing it correctly; I'm doing
var some_entity = {
   
...
};
viewer1
.entities.add(some_entity);
viewer2
.entities.add(some_entity);
...


Rachel Hwang

unread,
Jul 20, 2017, 11:42:40 AM7/20/17
to cesium-dev, rel...@gmail.com
Hi there,

Creating an entity then adding it to multiple viewers works for me. See this code example: http://cesiumjs.org/Cesium/Apps/Sandcastle/?src=Hello%20World.html&label=Showcases&gist=a12af66ed545a12d1bb83c02a4dad197

Hope that helps,
- Rachel
Reply all
Reply to author
Forward
0 new messages