- Home /
Is it necessary to use multiple materials when I only want to change one part of a model's color?
If a model has two colors and I only want to change the tint of one color while leaving the other color completely unaffected, do I have to use two materials - one for each color? I know that using another material adds another draw call, so I want to know if there is a better way before I implement this. Thanks.
Answer by Peter G · Apr 25, 2010 at 02:35 PM
That is one way or if you have the know how, you could change the vertex colors.
Make a texture that is grayscale in the part of the mesh you want to change. Create a shader that reads vertex colors along with the normal diffuse calculations. Procedurally change the vertex colors of the vertices and you would change the color of that part of the object.
Since finding the vertices to change would probably be semi-challenging strictly through iterating, you might want to change the colors in you modeler before you change the mesh procedurally. Then all the vertices you want to change will already have a predetermined vertex color value and you can just iterate through the vertices to find them instead of doing it based on position or another more complicated method.
Your answer
Follow this Question
Related Questions
Material doesn't have a color property '_Color' 4 Answers
Changing two different objects renderer colour 1 Answer
Materials Compatible with LineRenderer 1 Answer
using rgb to change color c# 1 Answer
Color wrong on IOS device 1 Answer