0 true #version 150 //OVE shader_name: luma key //OVE shader_description: ported from Olive 0.1 filters /* Luma key simple program Based on Edward Cannon's Simple Chroma Key (adaptation by Olive Team) Feel free to modify and use at will */ //OVE main_input_name: Input uniform sampler2D tex_in; //OVE name: lower limit //OVE type: FLOAT //OVE flag: NOT_CONNECTABLE //OVE min: 0 //OVE max: 100 //OVE default: 0 //OVE description: uniform float loc; //OVE name: upper limit //OVE type: FLOAT //OVE flag: NOT_CONNECTABLE //OVE min: 0 //OVE max: 100 //OVE default: 100 //OVE description: uniform float hic; //OVE name: invert //OVE type: BOOLEAN //OVE flag: NOT_CONNECTABLE //OVE default: false //OVE description: uniform bool invert; //OVE end // pixel coordinates in range [0..1]x[0..1] in vec2 ove_texcoord; // output color out vec4 frag_color; void main(void) { vec4 texture_color = texture(tex_in, ove_texcoord); float luma = max(max(texture_color.r,texture_color.g), texture_color.b) + min(min(texture_color.r,texture_color.g), texture_color.b); luma /= 2.0; if (luma > hic/100.0) { texture_color.a = (invert ? 0.0 : 1.0); } else if (luma < loc/100.0) { texture_color.a = (invert ? 1.0 : 0.0); } else { texture_color.a = (invert ? 1.0-luma : luma); } texture_color.rgb *= texture_color.a; frag_color = texture_color; } None 0 40 0 75 0 false 1897878214800 -1 -1 -1 -1 {114bacfc-96b2-4738-8074-4390bbdc9b71} {9b0707c3-5c71-4cab-aa76-ee5e663a000f} 0 -1.77976 0.0350877