XNA clip plane effect makes models black
- by user1990950
When using this effect file:
float4x4 World;
float4x4 View;
float4x4 Projection;
float4 ClipPlane0;
void vs(inout float4 position : POSITION0, out float4 clipDistances : TEXCOORD0)
{
clipDistances.x = dot(position, ClipPlane0);
clipDistances.y = 0;
clipDistances.z = 0;
clipDistances.w = 0;
position = mul(mul(mul(position, World), View), Projection);
}
float4 ps(float4 clipDistances : TEXCOORD0) : COLOR0
{
clip(clipDistances);
return float4(0, 0, 0, 0);
}
technique
{
pass
{
VertexShader = compile vs_2_0 vs();
PixelShader = compile ps_2_0 ps();
}
}
all models using this are rendered black. Is it possible to render them correctly?