2016-12-24 15:03:37 +00:00
|
|
|
#ifdef GL_ES
|
|
|
|
// Set default precision to medium
|
|
|
|
precision mediump int;
|
|
|
|
precision mediump float;
|
|
|
|
#endif
|
|
|
|
|
2016-12-31 11:31:38 +00:00
|
|
|
uniform mat4 vp_matrix;
|
2017-01-02 16:03:23 +00:00
|
|
|
uniform mat4 norm_matrix;
|
2016-12-31 11:31:38 +00:00
|
|
|
uniform mat4 m_matrix;
|
2016-12-24 15:03:37 +00:00
|
|
|
|
|
|
|
attribute vec4 a_position;
|
|
|
|
attribute vec2 a_texcoord;
|
2017-01-08 13:41:53 +00:00
|
|
|
attribute vec3 a_normal;
|
2016-12-24 15:03:37 +00:00
|
|
|
|
|
|
|
varying vec2 v_texcoord;
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2016-12-31 11:31:38 +00:00
|
|
|
// Calculate vertex position in screen space
|
2017-01-02 16:03:23 +00:00
|
|
|
gl_Position = vp_matrix * norm_matrix * m_matrix * a_position;
|
2016-12-24 15:03:37 +00:00
|
|
|
|
2016-12-31 11:31:38 +00:00
|
|
|
// Pass texture coordinate to fragment shader
|
|
|
|
// Value will be automatically interpolated to fragments inside polygon faces
|
|
|
|
v_texcoord = a_texcoord;
|
2016-12-24 15:03:37 +00:00
|
|
|
}
|