# GLTF Mesh picking highlight

**URL:** <https://community.cesium.com/t/gltf-mesh-picking-highlight/6765>\
**Category:** CesiumJS\
**Created:** [April 5, 2018, 1:25pm UTC](https://community.cesium.com/t/gltf-mesh-picking-highlight/6765 "2018-04-05T13:25:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Chang](https://avatars.discourse-cdn.com/v4/letter/m/85f322/32.png) [@Michael\_Chang](https://community.cesium.com/u/Michael_Chang)\
**Post date:** [April 5, 2018, 1:25pm UTC](https://community.cesium.com/t/gltf-mesh-picking-highlight/6765/1 "2018-04-05T13:25:46Z")

</div>

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

 ![Chanteloup.png](https://global.discourse-cdn.com/cesium/original/1X/2bfda84dd2c4139f6b20a8e47aee15da9742dd3f.png)

 ![ChanteloupHighlighted.png](https://global.discourse-cdn.com/cesium/original/1X/7762c712f4614ea97a16a7cbb179dc97e44e6c7e.png)

---

<div class="post-metadata">

**Author:** ![sean\_lilley](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/sean_lilley/32/2083_2.png) [@sean\_lilley](https://community.cesium.com/u/sean_lilley)\
**Post date:** [April 5, 2018, 11:40pm UTC](https://community.cesium.com/t/gltf-mesh-picking-highlight/6765/2 "2018-04-05T23:40:09Z")

</div>

What you’re seeing drawn is the pick color and it is not meant to be modified. The pick color correlates to a unique id associated with the node that enables picking to work. Internally the pick pass will render all pick commands to an offscreen framebuffer, read the pixel color at the mouses’s position, and then get the associated entity. Basically it’s not intended for setting an object’s color or rendering.

So long way to say we don’t yet have support for changing the color of a model node. It’s possible in 3D Tiles but not models alone.

There’s a Github issue open for this: [https://github.com/AnalyticalGraphicsInc/cesium/issues/2387](https://github.com/AnalyticalGraphicsInc/cesium/issues/2387)

---

<div class="post-metadata">

**Author:** ![tekutzner](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/tekutzner/32/3521_2.png) [@tekutzner](https://community.cesium.com/u/tekutzner)\
**Post date:** [December 12, 2019, 8:47pm UTC](https://community.cesium.com/t/gltf-mesh-picking-highlight/6765/3 "2019-12-12T20:47:55Z")

</div>

What about now?
