
//combined projection and view matrix
uniform mat4 u_projView;
uniform vec3 LightPos;        //light position, normalized

//"in" attributes from our SpriteBatch
attribute vec2 Position;
attribute vec2 TexCoord;
attribute vec4 Color;

//"out" varyings to our fragment shader
varying vec4 vColor;
varying vec2 vTexCoord;

//tom!
  varying vec4 fnormalView;
  varying vec4 ftangentView;      
  varying vec4 fbinormalView;

 
void main() {
    
 //   vec3 tan = normalize(vec3(LightPos.x-Position.x,LightPos.y-Position.y,0));
    vec3 tan = vec3(-0.5,0,0);
    
    fnormalView   = vec4(vec3((gl_NormalMatrix * gl_Normal)),0);
  // fnormalView   = vec4(vec3((gl_NormalMatrix)),0);
    ftangentView  = vec4(vec3((gl_NormalMatrix*tan)),0);
    //ftangentView  = vec4(vec3(normalize(gl_NormalMatrix * Tangent.xyz)),0);
    fbinormalView = vec4(cross(vec3(fnormalView), vec3(ftangentView)), 0);

	vColor = Color;
	vTexCoord = TexCoord;
	gl_Position = u_projView * vec4(Position, 0.0, 1.0);
}
