Sudden, offline, rendering error regarding max texture size on instantiation

So, the map is rendering just fine on my machine. My friend checks out my branch, forgets to pull, runs it – runs just fine missing my recent code, forgot to pull. He pulls, no lines edited whatsoever on the cesium portion of the code base – this is to do with a file-tree view on the side. Suddenly, we get a rendering error on the map. Not trying to render anything on the map, just the initial rendering of the map is failing and saying "Developer Error: Width must be less than or equal to the maximum texture size (0). Check maximumTextureSize.

It’s saying the maximum texture size is zero? Ok let’s go back to the earlier working commit. Same error appears in that commit suddenly, too.

We run our previously working executable (Wails – similar to electron) and the rendering error disappears for that executable, which was built from the main branch, which has no edits to the cesium portion of the code-base.

Can you please tell me what’s going on here?

Hi @TC-J ,

Thanks for your post and welcome to the Cesium community.

Sorry you ran into this issue. I am wondering if the error is something you can reproduce over time and on different machines or environments? From the error message, this sounds like some state in the browser that the Cesium library interfaces with got misaligned with switching commits. If this is the case, an action like clearing the cache or restarting the browser should reset the browser settings.

If the problem does persist over time and is reproducible, please let us know and we can definitely investigate as a possible bug.

Thanks,
Luke

I can get this to happen. After upgrading pass cesium 1.23 using angular version 19 this happens to me everytime I load a tile or even a billboard.

Its going past the cesium widget version 11.1 I think that does it after spending the morning trying different versions to track it down.

I found the problem code.

 TextureAtlas.prototype._resize = function (context, queueOffset = 0) {

  // Determine by what factor the texture need to be scaled by at minimum
  const areaDifference = areaQueued;
  let scalingFactor = 1.0;
  while (areaDifference / width / height >= 1.0) {
    scalingFactor *= 2.0;

    // Resize by one dimension
    if (width > height) {
      height *= scalingFactor;
    } else {
      width *= scalingFactor;
    }
  }

The scalingFactor overflows after several drawing loops.

change the code to below

      const scalingFactor = 2
      while (areaDifference / width / height >= 1) {
        if (width > height) {
          height *= scalingFactor
        } else {
          width *= scalingFactor
        }
      }

Thanks @caseycole589 for your follow up and sorry to hear you are encountering this problem.

Is it possible to try upgrading to a newer version of the library as 1.123 is about 7 months behind the latest 1.130.1 release? It is possible the bug was already reported and fixed.

@rpgpp are you seeing the same error message in a recent version of Cesium?

In order for us to further investigate this issue, it would be helpful for us to know if either of you are able to reproduce it in our sandcastle tool https://sandcastle.cesium.com/? If you are not able to reproduce it in sandcastle, we would need to know more about how you are using Cesium, so I would ask you to open an issue in the Cesium repo and include the versions for Browser, CesiumJS Version and Operating System.

I hope we can gather more information to resolve this issue shortly.
Thanks,
Luke

Upgrading has the same problem. I was originally on the latest and had to down grade cesium.

I don’t see a sandcastle that uses the single tile imagery provider. All the other ones work fine for me that is the only that causes the error. I will start a fresh project and try and find a image I can link to and use in sandcastle.

I switched to angular 19 and the old angular version 17 doesn’t have this problem.