From 30efe12077de49146c2fd026e7566512f9980886 Mon Sep 17 00:00:00 2001 From: = <=> Date: Wed, 23 Oct 2024 15:54:38 -0700 Subject: [PATCH] Added panel shader --- panel_vertex_shader.glsl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 panel_vertex_shader.glsl diff --git a/panel_vertex_shader.glsl b/panel_vertex_shader.glsl new file mode 100644 index 0000000..bd6728d --- /dev/null +++ b/panel_vertex_shader.glsl @@ -0,0 +1,18 @@ +#version 460 + +layout(packed, binding=0) buffer model_list { + mat4 models[]; +}; +layout(packed, binding=1) buffer scale_list { + vec2 scales[]; +}; +in vec3 in_vertex; +in vec2 in_texcoord; +uniform mat4 vp; +out vec2 frag_texcoord; +out vec4 gl_Position; + +void main(void) { + gl_Position = vp * models[gl_InstanceID] * vec4(in_vertex, 1.0); + frag_texcoord = (vec2(in_vertex.x, in_vertex.z) * 0.5 + vec2(0.5, 0.5)) * scales[gl_InstanceID]; +} -- 2.39.5