@header package main @header import sg "sokol/gfx" @header import glm "core:math/linalg/glsl" @ctype mat4 glm.mat4 @vs vs in vec2 position; in vec4 inst_mat0; in vec4 inst_mat1; in vec4 inst_mat2; in vec4 inst_mat3; in vec3 color; out vec4 vs_color; layout(binding=0) uniform vs_params { mat4 proj; }; void main() { mat4 model = mat4(inst_mat0, inst_mat1, inst_mat2, inst_mat3); gl_Position = model * vec4(position, 0.0, 1.0); vs_color = vec4(color, 1.0); } @end @fs fs in vec4 vs_color; out vec4 frag_color; void main() { frag_color = vs_color; } @end @program quad vs fs