I wrote this simple terrain multitex shader a while ago and I can not seem to figure out how to blur the terrain at a distance...
Code:
Texture entSkin1;
Texture mtlSkin1;
Texture mtlSkin2;
Texture mtlSkin3;
sampler2D tcolormap = sampler_state
{
Texture = (mtlSkin4);
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
};
sampler2D tgrass = sampler_state
{
Texture = (mtlSkin1);
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
};
sampler2D tdirt = sampler_state
{
Texture = (mtlSkin2);
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
};
sampler2D twater = sampler_state
{
Texture = (mtlSkin3);
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
};
struct PS_INPUT_STRUCT
{
float2 Tex : TEXCOORD0;
float3 light_angle : TEXCOORD1;
};
struct PS_OUTPUT_STRUCT
{
float4 c : COLOR0;
};
float4 veccycle;
PS_OUTPUT_STRUCT MyShader( PS_INPUT_STRUCT psInStruct, float4 inPos : POSITION)
{
PS_OUTPUT_STRUCT Color;
float4 Grass;
float4 Dirt;
float4 Water;
Color.c = tex2D( tcolormap, psInStruct.Tex.xy);
Grass = mul(tex2D( tgrass, mul(psInStruct.Tex.xy,800)),Color.c.g);
Dirt = mul(tex2D( tdirt, mul(psInStruct.Tex.xy,500)),Color.c.r);
Water = mul(tex2D( twater, mul(psInStruct.Tex.xy,120)),Color.c.b);
Color.c=Grass+Dirt+Water;
return Color;
}
technique PostProcess
{
pass p0
{
PixelShader = compile ps_2_0 MyShader();
}
}
Does anyone have any clue how I might go about doing this? You can use this if you want...
Thanks,
Brian