Error loading image for billboard: DeveloperError: Width must be less than ... maximum texture size

I have a rather large billboard which gets updated roughly ever 6 seconds. The billboard conforms to a customer standard (which contains a symbol, heading, speed, vehicle identifier, ...).

After some time I receive an error message stating "Error loading image for billboard: DeveloperError: Width must be less than or equal to the maximum texture size".

I believe I am running into the TextureAtlas problem documented in issue #2319 https://github.com/AnalyticalGraphicsInc/cesium/issues/2319
where every time I update the image on the billboard a new image is added to the TextureAtlas. Currently it does not seem that unused images are ever being reclaimed by the TextureAtlas.

I am trying to circumvent the problem from happening. I was thinking about creating a billboardCollection per image and rather than updating the billboard image attribute I would destroy the billboard collection which in turn would destroy the TextureAtlas. I then would recreate the billboardCollection and billboard with the new updated image.

I was wanting to know if anybody else has run into this problem past? And how did they get around it?

Thanks in advance

J. Stoy

Yeah, I brought this up as a potential issue in https://groups.google.com/d/topic/cesium-dev/cF9Vt28Wk-4/discussion .

It does seem like the situation could be definitely improved with a bit more bookkeeping internal to Cesium. It’s been far too low a priority for me to even consider trying to work on it myself, though.

Destroying the BillboardCollection certainly seems “wasteful”, but also seems like the only real answer at the moment. Maybe add some logic to only do it every so often?

Mark,

I agree, I'll put a count in place and if the count gets greater than X (some tunable value) i'll destroy and create the collection, and reset the count back to 0.

Thanks

J. Stoy

J. stoy,

I have experienced exactly the same issue when rendering approximately 2 ,000 billboards in less than 30 seconds with images of type canvas. I’m using the viewer.entities,Cesium version 1.9, and Firefox. The texture atlas for some unknown reasons can not keep up with the heavy loading of billboards. When this issue happens all the already rendered billboards increase in size indicating to me that tne texture atlas got full. I’m able to replicate the issue every time. The fix in my case was to first render one billboard in its own transaction, and then render the 2,000 billboards in another transaction. After I render the first billboard, I tested with 3000, 4000, 6000 and I don’t experienced the issue anymore. The texture atlas associated to the viewer.entities appears not to be fully initialized when I start the map. Only when I add one billboard, then everything is fine. I know my fix is not really a fix, but it is a workaround for the issue. I hope this workaround can give the Cesium experts a better understanding of the issue.

Thanks,

Alberto

.

This happens to me on FF no matter how many billboards I try to create. It can be 1 or 100 or 1000.
Happens 100% of the times.

Running Cesium 1.13 on FF 41.0.1.

The workaround did not help.

Hello Yonatan,

Can you please paste a code example? I can’t reproduce this error in Firefox 41.0.1

Thank you,

Hannah

Yonatan, this is a known issue in Chrome and Firefox when using SVG images. See issue #2907 for details: https://github.com/AnalyticalGraphicsInc/cesium/issues/2907

You specific error sounds like you are using an incorrect SVG file, that issue that Dan linked to has a comment from me on how to fix it.

This solved the issue on FF :slight_smile:
It was working on Chrome without issues. When I add the height/width, it now shows the double images bug (https://code.google.com/p/chromium/issues/detail?id=500180) even though I draw the image to a canvas and return the canvas to the billboard image.

It’s not hard to add height/width when in FF (or remove height/width when on chrome) since I already manipulate the SVG dynamically. But that’s not the case for most ppl I guess. Since it’s a browser’s issue, I guess we have nothing to do but hope it would be solved eventually.

Thanks a lot :slight_smile: