update shaders to #version 410

This commit is contained in:
Josh Holtrop 2014-06-26 12:00:04 -04:00
parent 3c22fed1fe
commit 2f7bac1d75
5 changed files with 18 additions and 8 deletions

View File

@ -1,3 +1,5 @@
#version 410
uniform vec4 color;
void main(void)

View File

@ -1,10 +1,12 @@
#version 410
/* Viewport width and height */
uniform ivec2 viewport_size;
/* Position of lower left corner of glyph */
uniform ivec2 position;
/* Vertex coordinates: x, y */
attribute vec2 coords;
layout(location = 0) in vec2 coords;
/**
* Map coordinates such that:
@ -17,5 +19,5 @@ vec2 map_to_screen(vec2 position)
void main(void)
{
gl_Position = vec4(map_to_screen((vec2)position + coords), 0, 1);
gl_Position = vec4(map_to_screen(vec2(position) + coords), 0, 1);
}

View File

@ -1,3 +1,5 @@
#version 410
/* Viewport width and height */
uniform ivec2 viewport_size;
/* Position of lower left corner of rectangle */
@ -6,7 +8,7 @@ uniform ivec2 position;
uniform ivec2 size;
/* Vertex coordinates: x, y (0 or 1) */
attribute ivec2 coords;
layout(location = 0) in ivec2 coords;
/**
* Map coordinates such that:
@ -19,5 +21,5 @@ vec2 map_to_screen(vec2 position)
void main(void)
{
gl_Position = vec4(map_to_screen((vec2)(position + coords * size)), 0, 1);
gl_Position = vec4(map_to_screen(vec2(position + coords * size)), 0, 1);
}

View File

@ -1,5 +1,7 @@
#version 410
/* Texture coordinate: s, t */
varying vec2 texture_coord_v;
in vec2 texture_coord_v;
/* Texture unit */
uniform sampler2D texture;

View File

@ -1,13 +1,15 @@
#version 410
/* Viewport width and height */
uniform ivec2 viewport_size;
/* Position of lower left corner of glyph */
uniform ivec2 position;
/* Vertex coordinates: x, y, s, t */
attribute vec4 coords;
layout(location = 0) in vec4 coords;
/* Output texture coordinate: s, t */
varying vec2 texture_coord_v;
out vec2 texture_coord_v;
/**
* Map coordinates such that:
@ -20,6 +22,6 @@ vec2 map_to_screen(vec2 position)
void main(void)
{
gl_Position = vec4(map_to_screen((vec2)position + coords.xy), 0, 1);
gl_Position = vec4(map_to_screen(vec2(position) + coords.xy), 0, 1);
texture_coord_v = coords.zw;
}