Original Post
OK, I got a very basic shader working in my app... problem is the mesh with the shader applied to it keeps on following my camera... it should be staying at the origin (identity matrix). According to my effectinstance my shader is only expecting the WorldViewProjection matrix. I feed it "identity * view * projection" matrix. Why does it behave like this? In my fx file that I posted below there's a variable that confuses me. "POSITION". My shader isn't expecting this from "SetTransform" as far as I know. Is it being read off some pipeline and causing the problem with my mesh? btw, my fx file simply turns my mesh purple and SHOULD stay put. //------------------------------------ float4x4 matWVP : WorldViewProjection; //------------------------------------ struct vertexInput { float3 Position : POSITION; }; struct vertexOutput { float4 HPosition : POSITION; float4 Diffuse : COLOR0; }; //------------------------------------ vertexOutput VS_TransformDiffuse(vertexInput IN) { vertexOutput OUT; OUT.HPosition = mul( float4(IN.Position.xyz , 1.0) , matWVP); OUT.Diffuse = float4(1.0f, 0.0f,1.0f,0.0f); return OUT; } //----------------------------------- technique textured { pass p0 { VertexShader = compile vs_1_1 VS_TransformDiffuse(); // Just use the color ColorArg1[0] = Diffuse; AlphaArg1[0] = Diffuse; ColorOp[0] = SelectArg1; AlphaOp[1] = SelectArg1; } }