From: = <=> Date: Wed, 23 Oct 2024 22:54:38 +0000 (-0700) Subject: Added panel shader X-Git-Url: https://isoptera.lcsc.edu/gitweb/?a=commitdiff_plain;h=30efe12077de49146c2fd026e7566512f9980886;p=example_engine%2F.git Added panel shader --- 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]; +}