@ctype mat4 mat4

@vs vs
layout(binding=0) uniform vs_params {
    mat4 mvp;
};

in vec4 position;
in vec3 norm;
in vec2 uv;

out vec3 fs_norm;
out vec2 fs_uv;

void main() {
    gl_Position = mvp * position;
    fs_norm = norm;
    fs_uv = uv;
}
@end

@fs fs
layout(binding=0) uniform texture2D tex;
layout(binding=0) uniform sampler smp;
in vec3 fs_norm;
in vec2 fs_uv;

out vec4 frag_color;

void main() {
    frag_color = texture(sampler2D(tex, smp), fs_uv);
    // frag_color = vec4(fs_norm * 0.5 + 0.5, 1.0);
    // vec2 uv = fs_uv * 0.5 + 0.5;
    // frag_color = vec4(uv, 0.0, 1.0);
}
@end

@program obj vs fs
