// force vc7 to group all shader related stuff into the Shader namespace
#ifdef WIN32
namespace Shader {
#endif

// define inputs from application
struct appin
{
  float4 position   : POSITION;
  float4 normal     : NORMAL;
  float3 texCoords0 : TEXCOORD0;
  float3 texCoords1 : TEXCOORD1;
};

// define outputs from vertex shader
struct vertout
{
  float4 position   : POSITION;
  float3 texCoords0 : TEXCOORD0;
  float3 texCoords1 : TEXCOORD1;
  float3 reflectionVector : TEXCOORD2;
  float3 color : COLOR;
};

vertout main(appin v_in, uniform float4x4 MVPMatrix,
             uniform float3 camPosition_object_space)
{
  vertout v_out;

  // transform vertex position into homogenous clip-space
  v_out.position   = mul(MVPMatrix, v_in.position);
  v_out.texCoords0 = v_in.texCoords0;
  v_out.texCoords1 = v_in.texCoords1;

  // normally, we should transform vertex & normal in world space
  // but for now...
  float3 positionW = v_in.position.xyz;
  float3 N = v_in.normal;
  float3 I = positionW - camPosition_object_space;
  v_out.reflectionVector = reflect(I,N);

  return v_out;
}

#ifdef WIN32
}
#endif