- Home /
The question is answered, right answer was accepted
Texture Takes Main Color of Material
I have an object and I want the texture to take on the main color of the material. The attached image shows the effect I am looking for: 1) a main color, 2) a texture, 3) the texture and color combination.
I made this image in Photoshop using the texture set to Hard Light, over the color layer. However, I want to do this with code as there is already a script determining the main material color.
Is there an economic way to allow layer passes on textures in a shader?
Answer by robertbu · Dec 03, 2013 at 09:21 PM
This can be done with shaders. If the texture is unlit, you can use this shader and set the mainColor as appropriate:
http://wiki.unity3d.com/index.php/Unlit
There are a number of lit shaders that also combine the mainColor with the texture. Start with the standard Diffuse shader.