EDIT:
Ich habe doch grad noch die Datei gefunden und hochgeladen:

dynamic_trees.rar


Die grasfading.fx
Quote:


float4x4 matWorld;
float4x4 matWorldInv;
float4x4 matWorldView;
float4x4 matView;
float4x4 matWorldViewProj;

float4 vecSunDir;
float4 vecSunPos;
float4 vecSunDiffuse = float4(200.f/255.f, 200.f/255.f, 200.f/255.f, 1.f);
float4 vecFog;
float4 vecLight;
float4 vecViewPos;

Texture entSkin1; // color and alpha
Texture entSkin2; // normal

float4 vecSkill41;//ambient
float4 vecSkill1;//sun position

float4 vecLightPos[8];
float4 vecLightColor[8];
float3 vecFalloff = float3(0.f, 0.f, 1.5f);

float4 grasscolor = {0.6,0.9,0.8,0.0};

sampler base = sampler_state
{
Texture = <entSkin1>;
MipFilter = LINEAR;
MinFilter = LINEAR;
MagFilter = LINEAR;
AddressU = clamp;
Addressv = clamp;
};


//////////////////////////////////////////////////////////////////////
struct TMULTI_VS_OUT // Output to the pixelshader fragment
{
float4 Pos : POSITION;
float Fog: FOG;
float2 tex : TEXCOORD0;
float4 alpha : COLOR1;
};


TMULTI_VS_OUT TMulti_VS(
float4 inPos : POSITION,
float3 inNormal : NORMAL,
float2 inTexCoord0 : TEXCOORD0)
{
TMULTI_VS_OUT Out;

// transform the vector position to screen coordinates
Out.Pos = mul(inPos,matWorldViewProj);

// Add fog
float3 PositionWorld = mul(inPos, matWorld);
float ofog = 1 - (distance(PositionWorld, vecViewPos) - vecFog.x) * vecFog.z;
Out.Fog = ofog;

// scale the texture coordinates for the masked textures
Out.tex = inTexCoord0.xy;

float alpha=(distance(PositionWorld, vecViewPos));

if (alpha>100)
{
Out.alpha.xyzw=1-(alpha*0.001);
}

else
{
Out.alpha.xyzw=1;
}

return Out;

}


float4 TMulti_PS(TMULTI_VS_OUT In): COLOR
{

// retrieve the pixels for the textures and the masks
float4 Color = tex2D(base,In.tex);

float4 finalcolor=Color*vecLight*1.7 ;
finalcolor*=grasscolor;

finalcolor.a = In.alpha * Color.w ;

return finalcolor;

}


technique tmulti3
{
pass one
{
// zenable=true;
zwriteenable=false;
alphablendenable=true;
cullMode=none;

VertexShader = compile vs_2_0 TMulti_VS();
PixelShader = compile ps_2_0 TMulti_PS();
}

}


Last edited by Pappenheimer; 06/19/08 11:28. Reason: Ergänzende Datei gefunden.