How to change model's material


I’ve loaded a model on the earth, but it doesn’t have any textures applied to it, and I want to add textures to it. It is composed of many parts, such as walls and glass. How can I add textures to these individual parts?
here is my codes:
Cesium.Model.fromGltfAsync({
url: ‘./model/ZL.gltf’,
modelMatrix: modelMatrix,
scale: 120,
}).then(function(model) {
// console.log(model);
entity = model
// 更改所有的模型颜色
// model.color = Cesium.Color.PURPLE

    viewer.scene.primitives.add(model);
})

You can change the material of the model using CustomShader, see Custom Shaders Models.

thanks, the image above shows the result of using this method. If I want to apply a texture to only a specific part, how can I do that? I couldn’t find ‘customShader’ on the model of this component

CustomShader can only be applied to the entire model or 3DTiles, and cannot be applied to a specific part unless you can distinguish which parts are specific in the shader. I suggest that you complete the work of adding textures in the modeling software.


OK thank you. I can find these components, but they don’t have the property customShader