How to change shininess of an already existing material?

Hi there,

i try to change the shininess of a material that is loaded directly from a glb file.

I am can already change the color of the object but now i try to add shininess or edit it.

function setMaterial(parent, type, mtl, new_color) {
 parent.traverse(o => {
   if (o.isMesh && o.nameID != null) {
     if (o.nameID == type) {
       //o.material = mtl;
       o.material.color.set(new_color);
     }
   }
 });
}

Is there a way to do something like that?

o.material.shininess.set(10);

How does setValues work ?

o.material.setValues({shininess:10});

Doesn’t seem to work…

o.material.shininess=10;

I don’t know why but i can’t change the shininess with this. Nothing is changing. Maybe i need to double check my code and the order. Will give feedback when i find the solution.

MeshStandardMaterial (which is what glTF models usually have) does not have a ‘shininess’ property. Try decreasing the roughness instead, that’s a similar PBR property. See: MeshStandardMaterial docs.

2 Likes

Ok thank you ! That explains why shininess is not working. I am trying now roughness and other parameter from MeshStandardMaterial