2019-01-30 12:11:34 +00:00
|
|
|
#version 330 core
|
|
|
|
|
2019-05-14 06:43:07 +00:00
|
|
|
#include <globals.glsl>
|
|
|
|
|
2019-02-23 02:41:52 +00:00
|
|
|
in vec2 v_pos;
|
2019-01-30 12:11:34 +00:00
|
|
|
in vec2 v_uv;
|
2019-02-23 02:41:52 +00:00
|
|
|
in vec4 v_color;
|
|
|
|
in uint v_mode;
|
2019-01-30 12:11:34 +00:00
|
|
|
|
2019-05-14 06:43:07 +00:00
|
|
|
layout (std140)
|
|
|
|
uniform u_locals {
|
|
|
|
vec4 w_pos;
|
|
|
|
};
|
|
|
|
|
2019-01-30 12:11:34 +00:00
|
|
|
uniform sampler2D u_tex;
|
|
|
|
|
|
|
|
out vec2 f_uv;
|
2019-02-23 02:41:52 +00:00
|
|
|
flat out uint f_mode;
|
|
|
|
out vec4 f_color;
|
2019-01-30 12:11:34 +00:00
|
|
|
|
|
|
|
void main() {
|
2019-05-02 22:42:04 +00:00
|
|
|
f_uv = v_uv;
|
|
|
|
f_color = v_color;
|
2019-05-14 06:43:07 +00:00
|
|
|
|
|
|
|
if (w_pos.w == 1.0) {
|
|
|
|
// In-game element
|
2019-05-24 01:07:19 +00:00
|
|
|
gl_Position = proj_mat * (view_mat * w_pos + vec4(v_pos, 0.0, 0.0));
|
2019-05-14 06:43:07 +00:00
|
|
|
} else {
|
|
|
|
// Interface element
|
|
|
|
gl_Position = vec4(v_pos, 0.0, 1.0);
|
|
|
|
}
|
2019-05-02 22:42:04 +00:00
|
|
|
f_mode = v_mode;
|
2019-01-30 12:11:34 +00:00
|
|
|
}
|