The imageryLayers of Cesium3DTileset cannot be added after the model rendering is completed, and the prompt: Maximum call stack size exceeded

The code is as follows:

Is it possible to create a sandcastle where the issue can be reproduced? I Just took the “Overlay Imagery on 3D Tiles” sandcastle, and moved the function to create and add the imagery provider into a setTimeout, and this seems to work:

If not: Maybe posting the relevant part of the stack trace could already help to narrow it down.

Thank you for your reply.You are right, I can indeed run your example test, but as long as I use the layers on my own server to do it, there will be an error. Sorry, I am unable to add test cases. This is my error message:

The error is from cesium/packages/engine/Source/Scene/ImageryLayer.js at 4b77c39685fa2c25ba5f7b8a2e703c714f9c8528 ¡ CesiumGS/cesium ¡ GitHub

What is the number of “levels” that this server claims to support?

(I could try to type the URL from the screenshot, but… don’t see a reason to spend time with that…)

1 Like

I have encountered a similar problem and solved it by modifying the ‘maximumCachedTiles’ parameter and ‘maximumLevel’ parameter. And I encountered another problem:when I add multiple imageryLayers to 3dtiles, there is a warning: ‘Draped imagery requires 12 texture units, truncating’.

1 Like

Thank you, it is indeed effective.

This might be a hint that the server is returning a wrong (or at least an unreasonably high) number of tile levels. (This should be independent of the draping, though - I’d expext the same error to happen when this imagery is draped on terrain).

Yes, this is a limitation because there is no “upsampling” of the geometry (some details are tracked in Follow-ups for draping imagery on 3D Tiles · Issue #12643 · CesiumGS/cesium · GitHub , but that’s a huge task that will sooner or later warrant its own issue for tracking it). There might be workarounds that could, for example, allow draping two imagery layers on 3D Tiles, but these would then have lower resolution (and 3 or 4 layers would hardly be feasible then).