XNA clip plane effect makes models black

Posted by user1990950 on Game Development See other posts from Game Development or by user1990950
Published on 2013-04-06T11:28:15Z Indexed on 2013/07/01 23:16 UTC
Read the original article Hit count: 276

Filed under:
|

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?

© Game Development or respective owner

Related posts about XNA

Related posts about effect