cesium icon indicating copy to clipboard operation
cesium copied to clipboard

cachedMaterial Cause an error in initializeMaterial

Open netcanol opened this issue 1 month ago • 1 comments

What happened?

if (defined(cachedMaterial)) {
    const template = clone(cachedMaterial.fabric, true);
    result._template = combine(result._template, template, true);
    translucent = cachedMaterial.translucent;
  }

In the current code, if the fabric contains texture information, and clone it will throw an exception.

in clone.js

 const result = new object.constructor();

this will triggering a texture exception.

function Texture(options) {
  options = options ?? Frozen.EMPTY_OBJECT;

  //>>includeStart('debug', pragmas.debug);
  Check.defined("options.context", options.context);
  //>>includeEnd('debug');

I encountered this error in version 1.135, but it worked fine in version 1.131.

Reproduction steps

...

Sandcastle example

No response

Environment

Browser: CesiumJS Version: Operating System:

netcanol avatar Nov 21 '25 05:11 netcanol

Hi @netcanol, thanks for reporting this bug. Could you possibly provide a minimal sandcastle that reproduces the issue? It would make it easier for us to root cause and test.

Based on the info you provided about working in version 1.131, I suspect #12767 may be the culprit here (who wrote that one...).

mzschwartz5 avatar Nov 21 '25 20:11 mzschwartz5