I'm only getting errors with setParameter()

These parameters are not really documented on purpose because they are not considered public API yet. You can use them but they might change without notice. Now having said that the material_diffuse parameter expects an array. So this should work:

this.entity.model.meshInstances[0].setParameter('material_diffuse', [1,1,1]);

The ‘proper’ way to change the diffuse color for now is to do it on the material like so:

material.diffuse = new pc.Color(1,1,1);
material.update();

This will change the color of the material anywhere that material is used. If you only want to change the color on specific models and not others then you better clone that material and assign it to the model first.

2 Likes