I'm trying to implement a vertex shader in my program.
I want to input a Transformed, Lit vertex via DrawPrimitiveUP
However, my vertex shader seems not to take effect.
What's the problem?
Vertex shader code (it compiles without error):
struct VertexIn
{
float4 Pos : POSITION;
float4 Diffuse : COLOR0;
float4 Specular : COLOR1;
float2 tex : TEXCOORD0;
};
struct VertexOut
{
float4 Pos : POSITION;
float4 Color : COLOR;
};
VertexOut VShader( VertexIn In )
{
VertexOut Out;
Out.Pos = In.Pos;
Out.Color = float4(1,1,1,1);
return Out;
}
technique FirstTechnique
{
pass FirstPass
{
Lighting = FALSE;
ZEnable = TRUE;
VertexShader = compile vs_2_0 VShader();
}
}
FVF vertex structure D3DTLVERTEX thats input via DrawPrimitiveUP:
struct D3DTLVERTEX
{
float x, y, z, rhw;
D3DCOLOR diffuse;
D3DCOLOR specular;
float tu, tv;
}
Any idea?