Files
oak-editor/app/shaders/alphaover.frag
T
itsmattkcandThomas Wilshaw a4056d8454 Upgrade to OpenGL ES 3.2 (#1879)
* upgrade to opengl 3.2

* cornerpin: no need for hack

* renderer: Update OCIO shader language to ES 3.0

Co-authored-by: Thomas Wilshaw <thomaswilshaw@gmail.com>
2022-03-20 11:17:18 -07:00

33 lines
648 B
GLSL

uniform sampler2D base_in;
uniform sampler2D blend_in;
uniform bool base_in_enabled;
uniform bool blend_in_enabled;
in vec2 ove_texcoord;
out vec4 frag_color;
void main(void) {
vec4 base_col = texture(base_in, ove_texcoord);
vec4 blend_col = texture(blend_in, ove_texcoord);
if (!base_in_enabled && !blend_in_enabled) {
frag_color = vec4(0.0);
return;
}
if (!base_in_enabled) {
frag_color = blend_col;
return;
}
if (!blend_in_enabled) {
frag_color = base_col;
return;
}
base_col *= 1.0 - blend_col.a;
base_col += blend_col;
frag_color = base_col;
}