void main(float3 position: POSITION,
          float4 color: COLOR,
          float2 texCoord0: TEXCOORD0,
          float2 texCoord1: TEXCOORD1,
          float3 normal: NORMAL,

          out float4 outColor: COLOR,
          out float4 outPosition: POSITION,
          out float2 outTexCoord0: TEXCOORD0,
          out float4 outTexCoord1: TEXCOORD1,

          uniform float4x4 modelViewProjectionMatrix, 
          uniform float4x4 projectionMatrix) 
{
  float s = texCoord1.x;
  float r = texCoord1.y;
  float x1 = texCoord0.x - 0.5; 
  float y1 = texCoord0.y - 0.5;
  float x2 = (cos(r) * x1 - sin(r) * y1) * s;
  float y2 = (sin(r) * x1 + cos(r) * y1) * s;
  float4 clipSpacePos = mul(modelViewProjectionMatrix, float4(position, 1)) + float4(x2, y2 , 0, 0);
  outPosition = clipSpacePos;
  outTexCoord0 = texCoord0;
  outTexCoord1 = clipSpacePos;
  outColor = color;
}
