Hello,
I am currently having an issue when trying to highlight a mesh from a gltf model with shared materials.
When selecting the object, this code is executed during left click event.
var pickedFeature = viewer.scene.pick(movement.position);
pickedFeature.node._runtimeNode.commands[“0”].command = pickedFeature.node._runtimeNode.commands[“0”].pickCommand;
I am able to change the color of the selected mesh as you can see in ChanteloupHighlighted.png.
However I have no control over the color, and when I try to force the color in the fragment shaders of all pickCommands by replacing
gl_FragColor = czm_pickColor;
with gl_FragColor = vec4(0.5,0.5,0.0,0.0);
I can’t select any features anymore.
I have also tried modifying colors of pickIds but the results are the same, I can’t select any features.
Since material are shared but shaders can be used to highlight different meshes that use the same material, is there anyway to control the highlighted color ?
Thanks,
Michael