1 registered members (Ayumi),
1,353
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
blurring terrain multitex at a distance...
#42428
03/11/05 11:44
03/11/05 11:44
|
Joined: Jan 2003
Posts: 47 Oklahoma
Blackberry
OP
Newbie
|
OP
Newbie
Joined: Jan 2003
Posts: 47
Oklahoma
|
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
|
|
|
Re: blurring terrain multitex at a distance...
[Re: Blackberry]
#42429
03/11/05 16:16
03/11/05 16:16
|
Joined: Oct 2003
Posts: 4,131
Matt_Aufderheide
Expert
|
Expert
Joined: Oct 2003
Posts: 4,131
|
Quote:
I can not seem to figure out how to blur the terrain at a distance...
What do you mean 'blur'? are you talking about mip mapping? or fogging? please clarify what you want.
|
|
|
|