33 lines
482 B
GLSL
33 lines
482 B
GLSL
@header const m = @import("math")
|
|
@ctype mat4 m.Mat4
|
|
|
|
/* main vertex shader */
|
|
@vs vs
|
|
in vec2 position;
|
|
in vec4 color0;
|
|
out vec4 color;
|
|
|
|
layout(binding = 0) uniform vs_params {
|
|
mat4 view;
|
|
mat4 projection;
|
|
};
|
|
|
|
void main() {
|
|
gl_Position = projection * view * vec4(position, 0, 1);
|
|
color = color0;
|
|
}
|
|
@end
|
|
|
|
/* main fragment shader */
|
|
@fs fs
|
|
in vec4 color;
|
|
out vec4 frag_color;
|
|
|
|
void main() {
|
|
frag_color = color;
|
|
}
|
|
@end
|
|
|
|
/* main shader program */
|
|
@program main vs fs
|