gtk2/gsk/gl/resources/mask.glsl
Matthias Clasen a9f50f1f7a gl: Support mask nodes
Add a shader for masking.
2023-02-12 08:35:25 -05:00

20 lines
354 B
GLSL

// VERTEX_SHADER:
// mask.glsl
void main() {
gl_Position = u_projection * u_modelview * vec4(aPosition, 0.0, 1.0);
vUv = vec2(aUv.x, aUv.y);
}
// FRAGMENT_SHADER:
// mask.glsl
uniform sampler2D u_mask;
void main() {
vec4 source = GskTexture(u_source, vUv);
vec4 mask = GskTexture(u_mask, vUv);
gskSetOutputColor(vec4 (source * mask.a));
}