Не понимаю почему так не работает?
Проверки тупо нету.

float4x4 matrixWorldViewProj : MATRIX_WORLDVIEWPROJ;
float4x4 matrixWorld : MATRIX_WORLD;
float3 lightDirection : LIGHT0_DIRECTION;
float4 lightColor : LIGHT0_COLOR;
float4 entityColor : COLOR_DIFFUSE;
float whatFace : VFACE;
texture diffuseTexture : TEXTURE_0;
sampler diffuseSampler = sampler_state
{
Texture = <diffuseTexture>;
AddressU = WRAP;
AddressV = WRAP;
AddressW = WRAP;
MinFilter = ANISOTROPIC;
MagFilter = ANISOTROPIC;
MipFilter = ANISOTROPIC;
MaxAnisotropy = 16;
};
struct VSInput {
float4 position : POSITION0;
float3 normal : NORMAL;
float2 texCoords : TEXCOORD0;
};
struct VSOutput {
float4 position : POSITION0;
float3 normal : TEXCOORD1;
float2 texCoords : TEXCOORD0;
};
VSOutput VSMain(VSInput input) {
VSOutput output;
output.position = mul (input.position, matrixWorldViewProj);
output.normal = normalize(mul(input.normal, matrixWorld));
output.texCoords = input.texCoords;
return output;
}
float4 PSMain( VSOutput input) : COLOR {
float4 diffuse = tex2D(diffuseSampler, input.texCoords);
float4 color;
color = tex2D( diffuseSampler, input.texCoords.xy);
if (diffuse.a < 0.5f) discard;
float lit;
if ( whatFace == -1 )
{
lit = dot(-input.normal , -lightDirection);
}
else
{
lit = dot(input.normal , -lightDirection);
}
return diffuse * entityColor * lit * lightColor;
}
technique Diffuse {
pass p0 {
PixelShader = compile ps_3_0 PSMain();
VertexShader = compile vs_3_0 VSMain();
CullMode = none;
}
}
Слева Хорс, справа шейдер:
