diff options
author | LaG1924 <lag1924@gmail.com> | 2021-06-13 10:47:33 +0200 |
---|---|---|
committer | LaG1924 <lag1924@gmail.com> | 2021-06-13 10:47:33 +0200 |
commit | f2266b843959413277767a990bb9a9c5593f3489 (patch) | |
tree | f26e90e9f7ceb9be3c108eb5129305356ac8df3a /cwd/assets/altcraft/shaders/vert/rml.vs | |
parent | Added RmlUi to CMakeLists.txt (diff) | |
download | AltCraft-f2266b843959413277767a990bb9a9c5593f3489.tar AltCraft-f2266b843959413277767a990bb9a9c5593f3489.tar.gz AltCraft-f2266b843959413277767a990bb9a9c5593f3489.tar.bz2 AltCraft-f2266b843959413277767a990bb9a9c5593f3489.tar.lz AltCraft-f2266b843959413277767a990bb9a9c5593f3489.tar.xz AltCraft-f2266b843959413277767a990bb9a9c5593f3489.tar.zst AltCraft-f2266b843959413277767a990bb9a9c5593f3489.zip |
Diffstat (limited to 'cwd/assets/altcraft/shaders/vert/rml.vs')
-rw-r--r-- | cwd/assets/altcraft/shaders/vert/rml.vs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/cwd/assets/altcraft/shaders/vert/rml.vs b/cwd/assets/altcraft/shaders/vert/rml.vs new file mode 100644 index 0000000..bfc50fb --- /dev/null +++ b/cwd/assets/altcraft/shaders/vert/rml.vs @@ -0,0 +1,21 @@ +#version 330 core + +uniform uvec2 viewportSize; +uniform mat4 rotationMat; + +layout (location = 0) in vec2 pos; +layout (location = 1) in uvec4 color; +layout (location = 2) in vec2 tex_coord; + +out VS_OUT { + vec4 color; + vec2 tex_coord; +} vs_out; + +void main() { + float x = (pos.x - viewportSize.x) / viewportSize.x; + float y = ((pos.y - viewportSize.y) / viewportSize.y) * -1; + gl_Position = vec4(x, y, -1.0f, 1.0f); + vs_out.color = vec4(float(color.x) / 255.0f, float(color.y) / 255.0f, float(color.z) / 255.0f, float(color.w) / 255.0f); + vs_out.tex_coord = tex_coord; +} |