- Home /
Blending a Color with a Material Texture
I am using Unity 4 Basic. I have a plane with a texture assigned to it that is my transparent shield effects. The texture itself uses white with different alpha for the effect.
I want to be able to tint this material with different colors at runtime for different types of shields.
How do I tint the texture 2d of a material at runtime?
Answer by whydoidoit · Dec 27, 2012 at 07:49 AM
You don't mention which shader you are using - presuming you are seeing transparency then we can presume you have used a transparent shader! You want one with a colour property and changing this colour in the shader will tint the material. Transparent/Diffuse has a colour property I believe.
that was it. I was trying to use the mobile / transparent / diffuse and it doesn't have a color
Yeah the mobile ones all don't have colour (performance reasons, but not to worry, it's not that bad)
Seems to work ok. I hope it works well on iOS.
Thank you!
Yeah it's fine (though $$anonymous$$imise transparency on older devices, it's a performance killer)