Delayed PBR-Shader?

Hi everyone,

after upgrading to @cesium/engine v17, I’ve noticed that the shading model appears to change dynamically after the application has been running for a while (sometimes 30-60 seconds, depending on the resources). This shift is quite noticable and distracting. I’d prefer to either have the new shading model active from the very start or to disable it entitely. Is this expected behavior in the latest version? Is there a recommended way to control or lock the shading model so it doesn’t change during runtime?


Hi @Hannes_N,

Could you perhaps provide a sandcastle example that demos this behavior? I was unable to reproduce this on the latest version of Cesium, here. So either I’m not setting it up the way you are, or perhaps this issue may not exist in the latest release.

If you’re able to, you could also try upgrading to @cesium/engine 18.3.0, and see if that helps.

Best,
@mzschwartz5

Hi @mzschwartz5,

after a bit of testing, I found out that the delayed application of the pbr shader somehow correlates with the number of separately loaded 3d tilesets. In the past we have split our building data into many 3d tilesets because it seemed to improve loading times in our application. We know that 3DTiles are optimized for massive datasets. However, the FME 2022 3DTileWriter we used until recently seemed to produce even more unoptimized 3D tiles.

I assume that this procedure generates so much overhead(?) that the generation of the PBR shading is delayed. By reducing the amount of separate 3d tilesets, we have been able to shorten the delay. Still, we couldn’t eliminate it. Do you have any ideas or suggestions on your side?

On another note, is it generally possible to disable the new PBR shading? Or any way of configuring it? We have already tried removing all postprocessing stages and so on, but without success.

Thanks in advance!

Based on the images in your original post, it looks like what is actually delayed is the application of an environment map / image-based lighting. It might be possible for you to pre-fetch environment maps before loading any tilesets, to avoid the delay.

If you really want to disable PBR shading, two choices:

  • Use a custom unlit shader for your models (example)
  • Use glTF models that don’t have PBR extension fields set in the first place. (Haven’t tested if this works, but I think it ought to).

Hope that helps!

1 Like

Hey @mzschwartz5,

you are right! It is indeed caused by the (dynamic) environment map. Disabling the dynamicEnvironmentMapManager like

tileset.environmentMapManager.enabled = false;

does prevent the visual change from occuring.

Thank you very much for your guidance.

I can proceed to work out an appropriate solution from here.

1 Like