colorShader and colorShaderOccQuery kept after serialize

OS: Windows 10 x64
Browser: ungoogled-chromium 108.0.5359.95
Babylon.js: 5.39.0
Playground: https://playground.babylonjs.com/#E9EBSL#1

Open the inspector and expend the materials.

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:

3 Likes