#version 150 compatibility

// simple pass-thru vertex shader.

uniform mat4 view_matrix;
uniform mat4 model_matrix;

attribute vec2 a_texcoord;
varying vec2 v_texcoord;
varying vec4 VertexColor;
varying vec4 WorldCoords;

void main(void) {
	
	gl_TexCoord[0] = gl_MultiTexCoord0;
	
	// https://www.khronos.org/registry/OpenGL/specs/gl/GLSLangSpec.1.10.pdf
	// 
	gl_Position = ftransform(); // equivalent to: gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex

	// gl_Vertex = the position of a vertex in model coordinates.

	// For GL 2.0 and 2.1, you could make use of built in uniforms such as gl_ProjectionMatrix and gl_ModelViewProjectionMatrix and many others.
	//gl_Position = gl_ProjectionMatrix * view_matrix * model_matrix * gl_Vertex;

	v_texcoord = a_texcoord;
	VertexColor = gl_Color;
	WorldCoords = gl_Position;

}
