You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
518 B
Plaintext

1 year ago
@module quad
1 year ago
@vs vs
1 year ago
in vec2 position;
in vec2 texcoord0;
out vec2 uv;
1 year ago
void main() {
1 year ago
gl_Position = vec4(position, 0.0, 1.0);
uv = texcoord0;
1 year ago
}
@end
@fs fs
1 year ago
uniform sampler2D tex;
1 year ago
uniform fs_params {
vec4 tint;
vec2 upper_left;
vec2 lower_right;
};
1 year ago
in vec2 uv;
1 year ago
out vec4 frag_color;
1 year ago
1 year ago
void main() {
1 year ago
vec2 actual_position = vec2(mix(upper_left.x, lower_right.x, uv.x), mix(upper_left.y, lower_right.y, uv.y));
frag_color = texture(tex, actual_position) * tint;
1 year ago
}
@end
1 year ago
@program program vs fs