- Home /
Blending one material/texture/shader to another
Hi
How do I blend a material into another material over a specific amount of time? I was thinking about something like crossfade, but for materials. I do not necessarily need to blend both textures and shaders at the same time. Sometimes I only want to blend into another shader, sometimes I want to blend into another texture. So I was wondering what command(s) can blend materials (textures and shaders)... If you have any other information regarding this you are welcome to post a comment.
Answer by ScroodgeM · Jul 27, 2012 at 12:04 PM
to lerp float and color values you can use:
http://docs.unity3d.com/Documentation/ScriptReference/Material.Lerp.html
to lerp textures you should use shader that supports blending. every shader can be easy improved to support it, or see below
to lerp shaders it's a one way to draw mesh using both shaders at once and blend results using lerp value as alpha. to implement this method one of shaders also should be improved a little
I have tried $$anonymous$$aterial.Lerp, but somehow it isn't working.
it's a built-in mechanism that laerps color and float values between materials, but not shaders or textures.
i'd explain answer a little
I made a completely new shader that is specially made for blending different textures and fixed the scripts to work with the shader. Now it works! Thanks for the help!