Adding VFACE semantic causes overlapping output semantics error

Posted by user1423893 on Game Development See other posts from Game Development or by user1423893
Published on 2012-07-10T10:13:32Z Indexed on 2012/07/10 15:26 UTC
Read the original article Hit count: 574

Filed under:
|

My pixel shader input is a follows

struct VertexShaderOut
{
    float4 Position                 : POSITION0;    
    float2 TextureCoordinates       : TEXCOORD0;
    float4 PositionClone            : TEXCOORD1;        // Final position values must be cloned to be used in PS calculations
    float3 Normal                   : TEXCOORD2;
    //float3x3 TBN                  : TEXCOORD3;
    float CullFace                  : VFACE;            // A negative value faces backwards (-1), while a positive value (+1) faces the camera (requires ps_3_0)
};

I'm using ps_3_0 and I wish to utilise the VFACE semantic for correct lighting of normals depending on the cull mode.

If I add the VFACE semantic then I get the following errors:

error X5639: dcl usage+index: position,0 has already been specified for an output register error X4504: overlapping output semantics

Why would this occur? I can't see why there would be too much data.

© Game Development or respective owner

Related posts about hlsl

Related posts about culling