Hi guys,
I already found the right shader that blends two textures with alpha mask: white → tex1 and black → tex2:
Shader "Custom/TwoTexMixAlphaMask" {
Properties{
_MainTex ("Main Texture (RGB)", 2D) = ""
_PathTex ("Path Texture (RGB)", 2D) = ""
_PathMask ("Path Mask (A)", 2D) = ""
}
SubShader {
Lighting On
Material {
Ambient [_Color]
Diffuse [_Color]
}
Pass{
SetTexture [_MainTex]
SetTexture [_PathMask]{
combine previous, texture
}
SetTexture [_PathTex]{
combine texture lerp(previous) previous
}
}
}
Fallback "Diffuse"
}
this works very good, the problem is, i need to tile both textures but not the alpha texure. So I try to use “bindChannels” to set the coords for the both UV sets, one for tiling sets and the other for non-tiling set:
BindChannels {
Bind "Vertex", vertex
Bind "texcoord", texcoord0 // 1st UV - tiling textures
Bind "texcoord1", texcoord1 // 2nd UV - lightmap and blend map
}
The result is: texture1 is tiled (correct!) alpha texture is not tiled (correct!) but the texure2 looks not like my tree texture, it is only brown colored, please have a look to my pictures to understand what i mean.
-
My original textures in the editor:
the last one is the alpha texure
-
after i applied the shader without “bindChannels”:
-
after i used “bindChannels” in my shader to apply the uv sets. The tree texture doesn’t looks like my original tree texture anymore:
It seems like the bindChannels assigns the coordinates not correct…
Can someone help me with this issue?