#version 430 core
layout (points) in;
layout (triangle_strip, max_vertices = 4) out;
in vec4 vColor [];
in vec2 vTexCoord [];
out vec4 gColor;
out vec2 gTex;
void main()
{
  vec3 cenPos = gl_in[0].gl_Position.xyz;
  float size = vTexCoord[0].y;
  //float size = 0.05;
  gColor = vColor[0];
  float texPos = vTexCoord[0].x;

  gl_Position = vec4 (cenPos.x - size*0.5, cenPos.y - size, cenPos.z , 1);
  //gl_Position = vec4 (0, 0 , 5 , 1);
  gTex = vec2 (texPos*0.0078125, 1);
  EmitVertex();
  gl_Position = vec4 (cenPos.x - size*0.5, cenPos.y + size, cenPos.z , 1);
  //gl_Position = vec4 (0, 0.5 , 5 , 1);
  gTex = vec2 (texPos*0.0078125, 0);
  EmitVertex();
  gl_Position = vec4 (cenPos.x + size*0.5, cenPos.y - size, cenPos.z , 1);
  //gl_Position = vec4 (0.5, 0.5 , -5 , 1);
  gTex = vec2 ((texPos+1)*0.0078125, 1);
  EmitVertex();
  gl_Position = vec4 (cenPos.x + size*0.5, cenPos.y + size, cenPos.z , 1);
  gTex = vec2 ((texPos+1)*0.0078125, 0);
  //gl_Position = vec4 (0.5, 0 , -5 , 1);
  EmitVertex();


  EndPrimitive();

}
