
#version 150
//Sky Vertex Shader

// vsPosition was bound to attribute index 0 and vsColor was bound to attribute index 1
in vec3 vsPosition;
in vec3 vsNormal;
in vec4 vsColor;
in vec2 vsTextureUV;

out vec3 fsPosition;

uniform mat4 uObjectToProjection;

void main(void)
{
	//.xyww will force w/w to put the sky verts at max depth.
	//gl_Position = (vec4(vsPosition, 1.0) * uObjectToProjection).xyww;
	//fsPosition = vec3(vec4(normalize(vsPosition), 0.0)).xyz;

	gl_Position = vec4(vsPosition.xy, 1.0, 1.0);
	fsPosition = vec3(vec4(vsPosition.x, vsPosition.y, 1.0, 1.0) * inverse(uObjectToProjection));
}
