- Home /
how to apply multiple layers of textures to a billboard?
I have one texture, the bottom layer. And another, the top layer, which has cutouts through which i want the bottom layer to be seen. I also require the layers to be self illuminating.
How do I achieve this? I've attempted to apply both to a single mesh but i don't know how to layer them. I can make the top layer transparent and i can see the bottom layer through it, but i don't know how to make it transparent and self illuminating.
Thanks for any help
Answer by Jessy · Feb 17, 2011 at 03:31 PM
Using two materials for this is slow. Use an appropriate shader for performance and ease of use. It's really simple, because "self-illuminating" is a misnomer. It just means you don't use lighting, which yields a performance hit and requires more complex code.
Shader "2-Texture Alpha Blend" {
Properties { _MainTex ("Top Texture (RGBA)", 2D) = "" _Texture2 ("Bottom Texture (RGB)", 2D) = "" }
SubShader {Pass { SetTexture[_Texture2] SetTexture[_MainTex] {Combine texture Lerp(texture) previous}
}}
}