- Home /
How do you tint a Mobile Diffuse material?
I know that you can modify the color of a material and tint it by setting the .color property, or by using SetColor on _color, but it doesn't seem to work for objects that have a Mobile Diffuse type material. Am I missing something, or does something else have to be done to tint these objects?
I'm really just doing it for debugging / illustration purposes.
Answer by xandermacleod · Jul 23, 2013 at 07:50 AM
Shaders are scripts just like any other script you would care to create, they are only unique in that they have a very specific job: to define how a surface behaves with lights.
Each shader is different due to the script that makes up that shader. Mobile Shaders are intended to be more efficient than other shaders because of the need to keep things simpler for mobile; so they have smaller scripts with fewer calculations.
In the default mobile shaders the color tint has been removed, but you could always open up the shader and try and add the tint back in if you wanted.
For an in depth look at writing shaders, or experimenting with shaders I would recommend you check out the following series of tutorials (they can get quite confusing to the uninitiated but do the best job Ive seen of trying to show you how to go about editing shaders): http://cgcookie.com/unity/cgc-courses/noob-to-pro-shader-writing-for-unity-4-beginner/
P.S. I think color tints are covered in the intermediary bit of that tutorial series, but its definitely not the kind of thing you want to just skip to.
Hope this helps.
Yes, @xandermacleod is right.
I totally forgot mobile shaders don't have color. You can see that yourself if you put a mobile shader on and object and look in the inspector.
I removed my stupid answer.
Fantastic answer. Thanks! I'll be sure to check out the tutorial series.
Your answer
![](https://koobas.hobune.stream/wayback/20220613110646im_/https://answers.unity.com/themes/thub/images/avi.jpg)