Should I use multiple BillboardCollections?

I am adding anywhere from 5K - 25K billboards to my map, alot of the icons are the same, but there could be over 1000 different icons used...

Is it more efficient to have 1 billboard collection for everything, or should I have a billboard collection per image (all billboards in that collection would share the same icon)?

Currently, I have made a prototype using 1 billboard collection where I reuse the same imageIndex from the billboard collection's TextureAtlas when an icon has already been used.

Thanks in advance for the feedback.

Does anybody know the answer to this?

As a general rule; the fewer billboard collections you have, the better performance will be. The only exception I can think of is if your data is geographically separated such that if one collection is in view others are not; you might get a slight performance increase (but that might be negligible) because all billboard’s in a collection are culled together. The above rule actually works for all Primitives and collections.

1000 different icons isn’t anything to worry about. It’s technically possible for a texture atlas to get too big; but that depends on the size of the icons and the capabilities of the underlying video card. For example, on my ancient 8800GT, the max texture size is 8192x8192, that’s 66592768 pixels. Even if all of my icons were 128x128, (16384 pixels), I would still be able to have 4096 icons before my texture got to big. If you have more reasonable icons, like 48x48, the limit is around 30k. So unless you have gigantic images, it will never be a problem.

Awesome, thanks.

Hi, Matthew. I wanted to follow up on this because I noticed the limitations of TextureAtlas the other day and posted a question about them ( https://groups.google.com/forum/#!topic/cesium-dev/cF9Vt28Wk-4 ), and someone else seemed to be actually experiencing this as a problem shortly thereafter ( https://groups.google.com/forum/#!topic/cesium-dev/Qd_LRhmlb50 ).

Would it be possible to update Billboard and TextureAtlas to allow updating the texture for a given image ID, rather than bailing out as it does now? Seems like that would greatly improve behavior in the case of dynamically updated billboards, as otherwise we do just keep having to add new textures to the same atlas.

Sorry for not getting back to you sooner. I just submitted an issue in Cesium to eventually cover this use case: https://github.com/AnalyticalGraphicsInc/cesium/issues/2319