I am having trouble getting rid of a grey edge to the masks I use in a multipass shader. The texture are tiled with a high frequency but the alpha mask is stretched acoss the whole object without tiling (so the reolution of the underlying texture and mask are quite different). As can be seen the edge of the white texture (which is pure white with no details) has a grey border (the edge is determined by an alpha mask) where it blends into the sand texture (the second image). If I repace the sand with a pure white texture (first image) then the whole image should be white, but I still see the grey edge at the boundary of the alpha mask. This problem doesn’t occur if I blend within one pass with the lerp interpolation, it just happens when blending between two passes. I suspect the problem is with my use of the “Blend” statement or it might be that the shader is bluring the edge of the texture between “Pass” blocks. Is it possible to switch of this blur until the very end of the shader??
Dunno if that makes any sense!
thanks,
Richard.
SubShader {
Pass {
// Apply base texture
SetTexture [_BottomTex] { combine texture }
// Load in the alpha blending texture
SetTexture [_LowerMiddleMask] { combine previous, texture }
// Blend in top layer with base layer using the alpha
SetTexture [_LowerMiddleTex] { combine texture lerp (previous) previous }
} // end pass
// middle layers (cobbles)
//======================
Pass{ // Blend SrcAlpha OneMinusSrcAlpha
Blend one OneMinusSrcAlpha
// Load in the alpha blending texture
SetTexture [_MiddleMask] { combine previous, texture }
// Blend in top layer with base layer using the alpha
SetTexture [_MiddleTex] { combine texture lerp (previous) previous }
} //end pass