#version 300 es
#extension all : warn

#pragma STDGL invariant(all)
#pragma optimize(on)
#pragma debug(on)

/* Precison */
precision highp float;
precision mediump int;
precision lowp samplerCube;

/* Uniform */
uniform mat4 projection_matrix;
uniform mat4 modelview_matrix;
uniform vec3 camera_position;

/* In */
in vec3 c_Vertex;
in vec2 c_TexCoord;
in vec3 c_Normal;

/* Out */
out vec3 texCoord2;

/* Main */
void main(void)
{
	vec4 pos = modelview_matrix * vec4(c_Vertex, 1.0);
	gl_Position = projection_matrix * pos;

	vec3 view = c_Vertex.xyz - camera_position.xyz;
	texCoord2 = -reflect(view, c_Normal);
}
