26 lines
648 B
GLSL
26 lines
648 B
GLSL
#version 300 es
|
|
|
|
/* Browser Webcam Test */
|
|
|
|
/* The precision declaration is required by OpenGL ES */
|
|
precision mediump float;
|
|
|
|
/* Values which are bound the VBO. */
|
|
in vec2 in_position;
|
|
in vec2 vertex_uv;
|
|
|
|
/* Will be forwarded to the fragment shader */
|
|
out vec2 uv;
|
|
|
|
/* Value is provided by the program when it sets the uniform value. */
|
|
uniform mat4 transformation;
|
|
|
|
void main(void)
|
|
{
|
|
/* Reflect 2D coordinates over the X-axis to flip the canvas coordinates into GL coordinates and return as a vec4 */
|
|
gl_Position = vec4(vec2(1, -1) * in_position, 0, 1);
|
|
|
|
/* Forward the UV coordinates to the fragment shader. */
|
|
uv = vertex_uv;
|
|
}
|