- Home /
Change color of material on a mesh on a mobile app
I have a mesh imported from Blender, in a mobile app. I would like to dynamically color it with a solid fill. It works When I use a MeshRenderer with a diffuse shader and then call:
this.myMesh.renderer.material.color = Color.yellow;
But when I use the mobile diffuse shader, it doesn't work. It doesn't seem to have a color property. I am guessing because that is inefficient on mobile devices.
In the end I would like to make the color of the object pulsate from one color to another, always solid fills. How can I achieve this efficiently on mobile?
Thanks, I compared the source of the two shaders, the mobile diffuse shader is the same as the normal diffuse shader, except it doesn't have the _Color property (and doesn't multiply the texture by it), and only accepts a single light.
I am happy to have a single light. And I think I can modify the mobile shader to use a specified color by multiplication. I wasn't sure why that would be expensive. Or how expensive that is.
Your answer
![](https://koobas.hobune.stream/wayback/20220613175238im_/https://answers.unity.com/themes/thub/images/avi.jpg)