You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Model.js caches shaders so that multiple Model instances that load the same glTF can share the same GL shader program. A model recreates a new shader for itself when it toggles a feature that would alter the shader source, such as clipping planes or color blend mode. One case where this is wasteful is when clipping planes are added to a 3D Tileset because all of the tiles recreate their own shader instead of sharing.
Model.js should have a global shader cache similar to GlobeSurfaceShaderSet where it caches based on feature state. This way shaders can be shared across many different glTFs. While CesiumJS has a lower-level shader cache this new system would avoid unnecessary processing.
One example where the old system has a bug is when a model has both clipping planes and specular environment maps and clipping planes get turned off. The model will fall back to the cached shader which didn't include the specular environment map code because the environment map wasn't ready when the shader was first created. This would be fixed in the new system if the shader key incorporates both the clipping plane and IBL state.
Model.js
caches shaders so that multipleModel
instances that load the same glTF can share the same GL shader program. A model recreates a new shader for itself when it toggles a feature that would alter the shader source, such as clipping planes or color blend mode. One case where this is wasteful is when clipping planes are added to a 3D Tileset because all of the tiles recreate their own shader instead of sharing.Model.js
should have a global shader cache similar toGlobeSurfaceShaderSet
where it caches based on feature state. This way shaders can be shared across many different glTFs. While CesiumJS has a lower-level shader cache this new system would avoid unnecessary processing.One example where the old system has a bug is when a model has both clipping planes and specular environment maps and clipping planes get turned off. The model will fall back to the cached shader which didn't include the specular environment map code because the environment map wasn't ready when the shader was first created. This would be fixed in the new system if the shader key incorporates both the clipping plane and IBL state.
Sandcastle
The text was updated successfully, but these errors were encountered: