   CG Phong shader
  Hy.I have create this CG phong shader , but it dont work when i bind it to my model matrix and camera position:i use world camera position and ProjectViewMatrix.//VSfloat4x4 VPMatrix;float4x4 WMatrix;float4   CameraModelPosition;float4   Light0WorldDirection;struct VS_OUTPUT {   float4 Pos:    POSITION;   float3 Norm:   TEXCOORD0;   float2 Tex:    TEXCOORD1;   float3 View:   TEXCOORD2;   float3 Light:  TEXCOORD3;};VS_OUTPUT vs_main(    float4 inPos: POSITION,  float3 inNorm:NORMAL,  float2 inTex: TEXCOORD0   ){   VS_OUTPUT Out = (VS_OUTPUT) 0;   Light0WorldDirection = float4(1, 1 , 0 ,0); Out.Pos = mul(mul(VPMatrix, inPos),WMatrix); Out.Light = Light0WorldDirection.xyz; Out.Tex = inTex; float3 vPosWorld = normalize( mul( WMatrix, inPos ) ).xyz; Out.View = normalize( CameraModelPosition - float4(vPosWorld.xyz,0) ).xyz; Out.Norm = normalize( mul( WMatrix, float4(inNorm.xyz,0))).xyz; return Out;}//PSfloat fShinyness;float4 colDiffuse;float4 colSpecular;float4 colAmbient;float4 lightAmbient;float4 lightDiffuse;float4 lightSpecular;float4 globalAmbient;sampler Texture0;float4 ps_main(    float3 inNorm:  TEXCOORD0,    float2 inTex:   TEXCOORD1,    float3 inView:  TEXCOORD2,    float3 inLight: TEXCOORD3   ) : COLOR{    fShinyness = 8;   colDiffuse = float4(1, 0, 0, 1);   colSpecular= float4(1, 1, 1, 1);   colAmbient= float4(0, 0, 0, 1);   lightAmbient= float4(0.3, 0, 0, 1);   lightDiffuse= float4(1, 0, 0, 1);   lightSpecular= float4(1, 0, 0, 1);   globalAmbient= float4(0.3, 0, 0, 1);   //normalize inputs   float3 vNormal = normalize(inNorm);   float3 vLight = -normalize(inLight);   float3 vView = normalize(inView); //calc diffuse/specular   float fNormalDotLight = saturate ( dot(vNormal, vLight) );float3 vLightReflect = 2.0*fNormalDotLight*vNormal - vLight; float fViewDotReflect = saturate( dot(vView, vLightReflect) );   float4 fSpecIntensity = pow(fViewDotReflect, fShinyness); float4 diffuse = fNormalDotLight * colDiffuse * lightDiffuse;   float4 specular = fSpecIntensity * colSpecular * lightSpecular;   float4 ambient = normalize( colAmbient * lightAmbient ) + globalAmbient;   return (ambient+ diffuse) /* tex2D(Texture0, inTex)*/ + specular;}technique Phong_Material{pass p0 {CullFaceEnable = false;VertexProgram = compile vp40 vs_main();FragmentProgram = compile fp40 ps_main();}}i have set all the vars for simple debug.whats wrong?[Edited by - giugio on April 11, 2010 1:26:09 PM]