Expected:
The colorShader and colorShaderOccQuery should be excluded from serialization and not being loaded again.
Referring to BABYLON.ShaderMaterial#doNotSerialize
Actual:
The colorShader and colorShaderOccQuery is serialized and loaded, and never reused again.
The two shaders used by the bounding box renderer are not flagged as doNotSerialize. If you don’t want to serialize them, you can set doNotSerialize=true:
[EDIT] You’re right, though, that we should not serialize them in the first place, so here’s the PR: