diff --git a/CHANGES.md b/CHANGES.md index 335b5a099893..140353e6f61e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -21,6 +21,7 @@ Change Log * `GroundPrimitive`s and `ClassificationPrimitive`s will become ready when `show` is `false`. [#6428](https://github.com/AnalyticalGraphicsInc/cesium/pull/6428) * Fix Firefox WebGL console warnings. [#5912](https://github.com/AnalyticalGraphicsInc/cesium/issues/5912) * Fix parsing Cesium.js in older browsers that do not support all TypedArray types. [#6396](https://github.com/AnalyticalGraphicsInc/cesium/pull/6396) +* Fixed a bug causing crashes when setting colors on un-pickable models. [$6442](https://github.com/AnalyticalGraphicsInc/cesium/issues/6442) * Fix flicker when adding, removing, or modifying entities. [#3945](https://github.com/AnalyticalGraphicsInc/cesium/issues/3945) * Fixed crash bug in PolylineCollection when a polyline was updated and removed at the same time. [#6455](https://github.com/AnalyticalGraphicsInc/cesium/pull/6455) * Fixed Imagery Layers Texture Filters Sandcastle example. [#6472](https://github.com/AnalyticalGraphicsInc/cesium/pull/6472). diff --git a/Source/Scene/Model.js b/Source/Scene/Model.js index 9aa1769fef2d..c53098437a4d 100644 --- a/Source/Scene/Model.js +++ b/Source/Scene/Model.js @@ -1973,7 +1973,7 @@ define([ /////////////////////////////////////////////////////////////////////////// // When building programs for the first time, do not include modifiers for clipping planes and color - // since this is the version of the program that will be cached. + // since this is the version of the program that will be cached for use with other Models. function createProgram(id, model, context) { var program = model._sourcePrograms[id]; var shaders = model._sourceShaders; @@ -4612,12 +4612,14 @@ define([ var pickProgram = rendererPickPrograms[programId]; nodeCommand.command.shaderProgram = renderProgram; - nodeCommand.pickCommand.shaderProgram = pickProgram; if (defined(nodeCommand.command2D)) { nodeCommand.command2D.shaderProgram = renderProgram; } - if (defined(nodeCommand.pickCommand2D)) { - nodeCommand.pickCommand2D.shaderProgram = pickProgram; + if (model.allowPicking) { + nodeCommand.pickCommand.shaderProgram = pickProgram; + if (defined(nodeCommand.pickCommand2D)) { + nodeCommand.pickCommand2D.shaderProgram = pickProgram; + } } }