	vec3 right = vec3(vs_right[0]);
	vec3 up = vec3(vs_up[0]);

	gl_Position.x = gl_PositionIn[0].x + right.x + up.x;
	gl_Position.y = gl_PositionIn[0].y + right.y + up.y;
	gl_Position.z = gl_PositionIn[0].z + right.z + up.z;
	gl_Position.w = 1.0;
	EmitVertex();

	gl_Position.x = gl_PositionIn[0].x - right.x + up.x;
	gl_Position.y = gl_PositionIn[0].y - right.y + up.y; 
	gl_Position.z = gl_PositionIn[0].z - right.z + up.z; 
	gl_Position.w = 1.0;
	EmitVertex();

	gl_Position.x = gl_PositionIn[0].x - right.x - up.x; 
	gl_Position.y = gl_PositionIn[0].y - right.y - up.y;
	gl_Position.z = gl_PositionIn[0].z - right.z - up.z;
	gl_Position.w = 1.0;
	EmitVertex();
	
	gl_Position.x = gl_PositionIn[0].x + right.x - up.x; 
	gl_Position.y = gl_PositionIn[0].y + right.y - up.y;
	gl_Position.z = gl_PositionIn[0].z + right.z - up.z;
	gl_Position.w = 1.0;
	EmitVertex(); 
	EndPrimitive();
	
	
	
uniform mat4 projection_matrix;
uniform mat4 view_matrix;

uniform samplerBuffer InstanceData;

in vec4 in_position;

varying vec3 vs_right;
varying vec3 vs_up;


//varying vec4 vs_out_Position;

void main(void)
{
	vs_right = vec3(view_matrix[0][0],view_matrix[1][0],view_matrix[2][0]);
	vs_up = vec3(view_matrix[0][1],view_matrix[1][1],view_matrix[2][1]);

	gl_Position = projection_matrix * view_matrix * in_position;
}

