#pragma language glsl3
#ifdef VERTEX
in vec3 VertexNormal;

uniform mat4 MVP;
uniform mat4 modelMatrix;

out vec3 vpos;
out vec3 vnorm;

vec4 position(mat4 transform_projection, vec4 vertex_position) {

  vpos = vertex_position.xyz;

  vnorm = ( modelMatrix * vec4(VertexNormal,0)).xyz;
  
  return  MVP*vertex_position;

}
#endif
 
#ifdef PIXEL

in vec4 pattern;
in vec3 vpos;
in vec3 vnorm;

uniform sampler2D MainTex;

uniform bool drawingShadow;
uniform float time=0;

void effect() {
  vec4 result = vec4(1);
  vec4 texel = vec4(1);
  vec4 col = VaryingColor;
  vec3 pos = vpos;
  vec3 norm = (normalize(vnorm)+vec3(1))/2;

  result = texel*col;

  love_Canvases[0] = result;
  love_Canvases[1] = vec4(norm,1);
  love_Canvases[2] = vec4(pos,1);
}
#endif

