#include <sun>
#include <light>
#include <normal>
texture entSkin1;
texture entSkin2;
float4 vecSkill41;
const float4x4 matWorldViewProj; // World*view*projection matrix.
sampler sBaseTex = sampler_state { Texture = <entSkin1>; MipFilter = Linear; };
sampler sSkin2 = sampler_state { Texture = <entSkin2>; MipFilter = None; };
void VSshade(in float4 InPos : POSITION,in float2 InTex : TEXCOORD0, in float3 InNormal: NORMAL, out float4 OutPos : POSITION, out float2 OutTex : TEXCOORD0, out float3 OutLight: COLOR)
{
OutPos = mul(InPos, matWorldViewProj);
OutLight = DoLight(OutPos,InNormal,1) + DoSunLight(InNormal);
OutTex = InTex;
}
float4 transperens_PS(in float2 InTex : TEXCOORD0, in float3 InLight: COLOR): COLOR
{
float3 color = tex2D(sSkin2,InTex);
float fValue = vecSkill41.x;
float fValue2 = vecSkill41.y;
if(fValue2 == 1)
{
if(color.x >= clamp(fValue - 0.05,-0.05,1))
{
return tex2D(sSkin2,sBaseTex) * InLight;
}
else
{
return float4(0,0,0,0);
}
}
else
{
if(color.x <= fValue)
{
return tex2D(sSkin2,sBaseTex) * InLight;
}
else
{
return float4(0,0,0,0);
}
}
}
technique filter
{
pass one
{
VertexShader = compile vs_2_0 VSshade();
PixelShader = compile ps_2_0 transperens_PS();
}
}