gear/shaders/shader.glsl

31 lines
378 B
Text
Raw Permalink Normal View History

2024-08-17 19:12:22 +12:00
@vs vs
2024-08-31 17:42:56 +12:00
in vec4 pos;
in vec4 color0;
2024-08-18 15:21:25 +12:00
in vec2 texcoord0;
2024-08-17 19:12:22 +12:00
2024-08-18 15:21:25 +12:00
out vec2 uv;
2024-08-31 17:42:56 +12:00
out vec4 color;
2024-08-17 19:12:22 +12:00
void main() {
2024-08-31 17:42:56 +12:00
gl_Position = pos;
2024-08-18 15:21:25 +12:00
uv = texcoord0;
2024-08-31 17:42:56 +12:00
color = color0;
2024-08-17 19:12:22 +12:00
}
@end
@fs fs
2024-08-18 15:21:25 +12:00
uniform texture2D tex;
uniform sampler smp;
in vec2 uv;
2024-08-31 17:42:56 +12:00
in vec4 color;
2024-08-17 19:12:22 +12:00
out vec4 frag_color;
void main() {
2024-08-31 17:42:56 +12:00
frag_color = texture(sampler2D(tex, smp), uv) * color;
2024-08-17 19:12:22 +12:00
}
@end
@program triangle vs fs