@vs vs
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;

}
@end
 
@fs fs

layout (location = 0) out vec4 g_diffuse;
layout (location = 1) out vec4 g_normal;
layout (location = 2) out vec4 g_position;

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

uniform sampler2D MainTex;

uniform bool drawingShadow;
uniform float time=0;

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

  result = texel*col;

  g_diffuse = result;
  g_normal = vec4(norm,1);
  g_position = vec4(pos,1);
}
@end

