Globe material flickers when updating

The globe material is flickering white when setting to a new value. This behavior can be observed in the Globe Material Sandcastle here, when toggling the different shading options form the radio selections. I was hoping something like the below code would fix it, but it doesn’t work.

globe.material = new Cesium.CallbackProperty(getMaterial, false);

Hi @rlueders,

I also see the flash. I believe this is because a new texture needs to be created for the image with the color ramp. In the meantime, the material is falling back to the default texture, which is white.

May I ask what your use case is? Depending on that, we can probably recommend a workaround.

Thanks,
Gabby

By the way, the flash to white is documented in this issue on GitHub.

Thanks for the reply Gabby. That seems odd. I would think the existing texture would be used until the new texture is ready, rather than falling back to a default.

My usecase is driving the shading colors/transparency from a slider. For example, similar to the sandcastle demo, I am calling updateMaterial() to change the globe’s material. However, I am calling it continuously as a slider value representing desired transparency changes. On each execution of updateMaterial(), the transparency/alpha value used in getColorRamp() is slightly different based on the slider’s new position. Since the updateMaterial() function is called fairly rapidly as the slider changes, the the material is flickering for the duration of the sliders movement.