I guess I do know how change the color of a loaded GLTF model (for highlighting purposes)
Currently I’m loading the GLTF models and via the ID of the GLTF entities I can find the the GLTF Models in the Cesium.Viewer.scene.primitives.
There I can browse through the nodes and meshes of a GLTF model. I see that the meshes have a material property however I 'm not sure how to set a color or even if this is the correct way to go? All help is appreciated.
I have a similar issue related to the changing of the model material value. I am using the glTF model having texture images (and not cartesian color values). I have attached the screenshot for your review. In order to provide highlighting effect, I am willing to either change the brightness of the model (e.g. make the model more or less bright) or provide a highlighting color on top of that. If the glTF model contains the color values, I can easily change its color using model.getMaterial and then modelMaterial.setValue. But I am not sure how would I change the material values in case of texture images. Any help would be appreciated.
We recently announced 3D building works being done in Cesium, here’s the forum thread about it: https://groups.google.com/d/msg/cesium-dev/IArj5ju4cI8/JjuND35APT8J As far as I know (I could be wrong) there’s no easy way to do what you want right now, but we will be exploring such capabilities in the near future.
I can easily change its color using model.getMaterial and then modelMaterial.setValue. But I am not sure how would I change the material values in case of texture images. Any help would be appreciated.
When textures are used, the glTF material might still have a diffuse property that is multiplied with each texel read from the texture. If so, just set it as before. If not, you could post-process the glTF to use a custom material and fragment shader so you can set any value you want.