   HLSL Problem...ARGGHH!!!....I just don't get it!
  Hi.In the following abbreviated code, I'm sending Vector3 Position to the HLSL variable float3 EyePosition.  Then in the vertex shader, the following three lines:reflPos[0] = EyePosition[0];   //INCORRECTreflPos[1] = -EyePosition[1] + (inPos[1] * 2);//CORRECTreflPos[2] = EyePosition[2];   //INCORRECT the value of reflPos is (0, -1000, 0), regardless of the value of Position....should be (512, -1000, 550).   Can anybody explain WHY?  public Vector3 Position = new Vector3(512.0f, 1000.0f, 550.0f);...public void DrawTerrain(){...effect.Parameters["EyePosition"].SetValue(Position);...effect.Begin();foreach (EffectPass pass in effect.CurrentTechnique.Passes){    pass.Begin();    GraphicsDevice.DrawUserIndexedPrimitives(   clip.PrimitiveType,    clip.Vertices,    0,    clip.Vertices.Length,    clip.Indices,    0,    clip.Triangles);    pass.End();}effect.End();}/////////////HLSL/////////////////////float3 reflPos;uniform const float3EyePosition;....VertexShaderOutput VertexShaderFunction(float4 inPos : POSITION){    VertexShaderOutput output = (VertexShaderOutput)0;...reflPos[0] = EyePosition[0];   //INCORRECTreflPos[1] = -EyePosition[1] + (inPos[1] * 2);//CORRECTreflPos[2] = EyePosition[2];   //INCORRECT }   
  Is reflPos[0] and reflPos[2] used in the shader later? If not that may be the problem. Unused variables will most probably be discarded by the compiler.;  IMO, the array notation is making that code very confusing.reflPos[0] = EyePosition[0];reflPos[1] = -EyePosition[1] + (inPos[1] * 2);reflPos[2] = EyePosition[2];The above is equivalent to:reflPos.x = EyePosition.x;reflPos.y = -EyePosition.y+ (inPos.y * 2);reflPos.z = EyePosition.z;What do your INCORRECT/CORRECT comments mean? Are you saying you should only initialise the y component and leave x/z undefined?   ;  The CORRECT/INCORRECT means that the values of reflPos[0] and reflPos[2] appear to be incorrect....always 0, where the value of reflPos[1] seems to be correct.   