update shaders to #version 410
This commit is contained in:
parent
3c22fed1fe
commit
2f7bac1d75
@ -1,3 +1,5 @@
|
|||||||
|
#version 410
|
||||||
|
|
||||||
uniform vec4 color;
|
uniform vec4 color;
|
||||||
|
|
||||||
void main(void)
|
void main(void)
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
|
#version 410
|
||||||
|
|
||||||
/* Viewport width and height */
|
/* Viewport width and height */
|
||||||
uniform ivec2 viewport_size;
|
uniform ivec2 viewport_size;
|
||||||
/* Position of lower left corner of glyph */
|
/* Position of lower left corner of glyph */
|
||||||
uniform ivec2 position;
|
uniform ivec2 position;
|
||||||
|
|
||||||
/* Vertex coordinates: x, y */
|
/* Vertex coordinates: x, y */
|
||||||
attribute vec2 coords;
|
layout(location = 0) in vec2 coords;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map coordinates such that:
|
* Map coordinates such that:
|
||||||
@ -17,5 +19,5 @@ vec2 map_to_screen(vec2 position)
|
|||||||
|
|
||||||
void main(void)
|
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);
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#version 410
|
||||||
|
|
||||||
/* Viewport width and height */
|
/* Viewport width and height */
|
||||||
uniform ivec2 viewport_size;
|
uniform ivec2 viewport_size;
|
||||||
/* Position of lower left corner of rectangle */
|
/* Position of lower left corner of rectangle */
|
||||||
@ -6,7 +8,7 @@ uniform ivec2 position;
|
|||||||
uniform ivec2 size;
|
uniform ivec2 size;
|
||||||
|
|
||||||
/* Vertex coordinates: x, y (0 or 1) */
|
/* Vertex coordinates: x, y (0 or 1) */
|
||||||
attribute ivec2 coords;
|
layout(location = 0) in ivec2 coords;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map coordinates such that:
|
* Map coordinates such that:
|
||||||
@ -19,5 +21,5 @@ vec2 map_to_screen(vec2 position)
|
|||||||
|
|
||||||
void main(void)
|
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);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
|
#version 410
|
||||||
|
|
||||||
/* Texture coordinate: s, t */
|
/* Texture coordinate: s, t */
|
||||||
varying vec2 texture_coord_v;
|
in vec2 texture_coord_v;
|
||||||
|
|
||||||
/* Texture unit */
|
/* Texture unit */
|
||||||
uniform sampler2D texture;
|
uniform sampler2D texture;
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
|
#version 410
|
||||||
|
|
||||||
/* Viewport width and height */
|
/* Viewport width and height */
|
||||||
uniform ivec2 viewport_size;
|
uniform ivec2 viewport_size;
|
||||||
/* Position of lower left corner of glyph */
|
/* Position of lower left corner of glyph */
|
||||||
uniform ivec2 position;
|
uniform ivec2 position;
|
||||||
|
|
||||||
/* Vertex coordinates: x, y, s, t */
|
/* Vertex coordinates: x, y, s, t */
|
||||||
attribute vec4 coords;
|
layout(location = 0) in vec4 coords;
|
||||||
|
|
||||||
/* Output texture coordinate: s, t */
|
/* Output texture coordinate: s, t */
|
||||||
varying vec2 texture_coord_v;
|
out vec2 texture_coord_v;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map coordinates such that:
|
* Map coordinates such that:
|
||||||
@ -20,6 +22,6 @@ vec2 map_to_screen(vec2 position)
|
|||||||
|
|
||||||
void main(void)
|
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;
|
texture_coord_v = coords.zw;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user