Thanks for your answer, i cant get the shader from your link running, i keep getting errors but im not sure if it really does what i need. What im doing at the moment is using an Shader i found.
Works ok, but i need the corners of the platform to use transparency (Grass should hang over) and again im searching for days to make it work.
I tryed with the TerrainTransparency Shader from the wiki but if i add an transparent PNG as Texture its always white.
Im really surprised how hard it is, i thought this will be the simple part of my project.
All i need is a Shader that allows me to paint different colors for different tiled textures and a color or alphamask to make some parts of the mesh transparent.
Shader "4TextureBlend"
{
Properties
{
_Control ("Control (RGBA)", 2D) = "red" {}
_Splat3 ("Layer 3 (A)", 2D) = "white" {}
_Splat2 ("Layer 2 (B)", 2D) = "white" {}
_Splat1 ("Layer 1 (G)", 2D) = "white" {}
_Splat0 ("Layer 0 (R)", 2D) = "white" {}
// used in fallback on old cards
_MainTex ("BaseMap (RGB)", 2D) = "white" {}
_Color ("Main Color", Color) = (1,1,1,1)
}
SubShader
{
Tags
{
"SplatCount" = "4"
"Queue" = "Geometry-100"
"RenderType" = "Opaque"
}
CGPROGRAM
#pragma surface surf Lambert vertex:vert
struct Input
{
float2 uv_Control : TEXCOORD0;
float2 uv_Splat0 : TEXCOORD1;
float2 uv_Splat1 : TEXCOORD2;
float2 uv_Splat2 : TEXCOORD3;
float2 uv_Splat3 : TEXCOORD4;
};
void vert (inout appdata_full v)
{
float3 T1 = float3(1, 0, 1);
float3 Bi = cross(T1, v.normal);
float3 T = normalize(cross(v.normal, Bi));
v.tangent.xyz = T.xyz;
if (dot(cross(v.normal, T),Bi) < 0)
v.tangent.w = -1.0f;
else
v.tangent.w = 1.0f;
}
sampler2D _Control;
sampler2D _Splat0,_Splat1,_Splat2,_Splat3,_Splat4,_Splat5,_Splat6,_Splat7;
void surf (Input IN, inout SurfaceOutput o)
{
fixed4 splat_control = tex2D (_Control, IN.uv_Control);
fixed3 col;
fixed3 nor;
col = splat_control.r * tex2D (_Splat0, IN.uv_Splat0).rgb;
col += splat_control.b * tex2D (_Splat1, IN.uv_Splat1).rgb;
col += splat_control.g * tex2D (_Splat2, IN.uv_Splat2).rgb;
col += splat_control.a * tex2D (_Splat3, IN.uv_Splat3).rgb;
o.Albedo = col;
o.Alpha = 0.0;
}
ENDCG
}
// Fallback to Diffuse
Fallback "Diffuse"
}