2019-01-14 23:13:58 +00:00
|
|
|
#version 330 core
|
|
|
|
|
2019-05-12 09:10:13 +00:00
|
|
|
#include <globals.glsl>
|
|
|
|
|
2019-05-22 18:30:18 +00:00
|
|
|
in uint v_pos;
|
|
|
|
in uint v_col_norm;
|
2019-01-14 23:13:58 +00:00
|
|
|
|
|
|
|
layout (std140)
|
|
|
|
uniform u_locals {
|
|
|
|
vec3 model_offs;
|
|
|
|
};
|
|
|
|
|
|
|
|
out vec3 f_pos;
|
|
|
|
out vec3 f_norm;
|
|
|
|
out vec3 f_col;
|
|
|
|
|
|
|
|
void main() {
|
2019-05-22 18:30:18 +00:00
|
|
|
f_pos = vec3(
|
|
|
|
float((v_pos >> 0) & 0x00FFu),
|
|
|
|
float((v_pos >> 8) & 0x00FFu),
|
|
|
|
float((v_pos >> 16) & 0xFFFFu)
|
|
|
|
);
|
|
|
|
|
|
|
|
f_norm = vec3(
|
|
|
|
float((v_col_norm >> 0) & 0x3u),
|
|
|
|
float((v_col_norm >> 2) & 0x3u),
|
|
|
|
float((v_col_norm >> 4) & 0x3u)
|
|
|
|
) - 1.0;
|
|
|
|
|
|
|
|
f_col = vec3(
|
|
|
|
float((v_col_norm >> 8) & 0xFFu),
|
|
|
|
float((v_col_norm >> 16) & 0xFFu),
|
|
|
|
float((v_col_norm >> 24) & 0xFFu)
|
|
|
|
) / 255.0;
|
2019-01-14 23:13:58 +00:00
|
|
|
|
|
|
|
gl_Position =
|
|
|
|
proj_mat *
|
|
|
|
view_mat *
|
2019-05-22 18:30:18 +00:00
|
|
|
vec4(f_pos + model_offs, 1);
|
2019-01-14 23:13:58 +00:00
|
|
|
}
|