// Vertex Shader:
void TerrPaintVS(
in float4 InPos: POSITION,
in float2 InTex: TEXCOORD0,
out float2 OutTex: TEXCOORD0,
out float4 OutPos: POSITION,
out float4 OutCoords: TEXCOORD1)
{
// Transform the vertex from object space to world space:
OutPos = mul(InPos, matWorld);
OutCoords=OutPos;
// Pass the texture coordinate to the pixel shader:
OutTex = InTex;
}
// Pixel Shader:
float4 TerrPaintPS(
in float2 InTex: TEXCOORD0,
in float4 InCoords: TEXCOORD1): COLOR
{
float4 Color;
if(InCoords.y<16) Color = tex2D(SandSampler, InTex);
else if(InCoords.y<50) Color = tex2D(GrassSampler, InTex);
else if(InCoords.y<75) Color = tex2D(RockSampler, InTex);
else Color = tex2D(SnowSampler, InTex);
return Color;
}