float4x4 matWorldViewProj;
float4x4 matWorld;
float4 vecViewDir;
float4 vecSkill41;
texture entSkin1;
texture entSkin2;
sampler ColorMapSampler = sampler_state
{
Texture = <entSkin1>;
AddressU = Wrap;
AddressV = Wrap;
};
sampler ColorMapSampler2 = sampler_state
{
Texture = <entSkin2>;
AddressU = Wrap;
AddressV = Wrap;
};
void BlendVS(
in float4 InPos: POSITION,
in float3 InNormal: NORMAL,
in float2 InTex: TEXCOORD0,
out float4 OutPos: POSITION,
out float2 OutTex: TEXCOORD0,
out float3 OutNormal: TEXCOORD1)
{
OutPos = mul(InPos, matWorldViewProj);
OutNormal = mul(InNormal, matWorld);
OutTex = InTex;
}
float4 BlendPS(
in float2 InTex: TEXCOORD0,
in float3 InNormal: TEXCOORD1): COLOR
{
float4 Color = tex2D(ColorMapSampler, InTex);
float4 Color2 = tex2D(ColorMapSampler2, InTex);
float Diffuse = saturate(dot(normalize(InNormal),-vecViewDir));
Color = lerp(Color,Color2,vecSkill41.x);
return Color*(Diffuse*0.5+0.5);
}
technique DiffuseTechnique
{
pass P0
{
VertexShader = compile vs_2_0 BlendVS();
PixelShader = compile ps_2_0 BlendPS();
}
}