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.
asked Apr 25 '10 at 02:12 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.
answered Apr 25 '10 at 02:35 PM