Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug with unpickable Models and shader modification #6444

Merged
merged 2 commits into from
Apr 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
10 changes: 6 additions & 4 deletions Source/Scene/Model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}
}

Expand Down