From 24023f77978df24eaac4a06b53e0801394a29d78 Mon Sep 17 00:00:00 2001 From: Brett Laptop Date: Tue, 11 Jul 2023 18:35:02 -0400 Subject: [PATCH] fix scale op in mat4x4 --- include/parks/shader/ui_shader.frag | 17 ++++++++++++++++ include/parks/shader/ui_shader.vert | 30 +++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 include/parks/shader/ui_shader.frag create mode 100644 include/parks/shader/ui_shader.vert diff --git a/include/parks/shader/ui_shader.frag b/include/parks/shader/ui_shader.frag new file mode 100644 index 0000000..c8f44ec --- /dev/null +++ b/include/parks/shader/ui_shader.frag @@ -0,0 +1,17 @@ +#include +static std::string BasicShaderFragment = R"(" +#version 330 core + +in vec3 colors; +in vec2 uvs; + +out vec4 color; + +uniform sampler2D tex; + +void main() +{ + color = vec4(colors, 1.0) * texture(tex, uvs); +} + +")"; \ No newline at end of file diff --git a/include/parks/shader/ui_shader.vert b/include/parks/shader/ui_shader.vert new file mode 100644 index 0000000..dd0f901 --- /dev/null +++ b/include/parks/shader/ui_shader.vert @@ -0,0 +1,30 @@ +#ifdef __cplusplus +#include +static std::string BasicShaderVertex = R"(" +#version 460 core + +layout (location = 0) in vec3 position; +layout (location = 1) in vec3 color; +layout (location = 2) in vec2 uv; + +out vec3 colors; +out vec2 uvs; + +layout (std140) uniform Matrices +{ + mat4 perspective; + mat4 view; + mat4 pvm; + mat4 ortho; +}; + +void main() +{ + gl_Position = pvm * vec4(position.x, position.y, position.z, 1.0); + colors = color; + uvs = uv; +} + + +")"; +#endif \ No newline at end of file