diff --git a/effects/lumakey.frag b/effects/lumakey.frag new file mode 100644 index 000000000..3e7b0d266 --- /dev/null +++ b/effects/lumakey.frag @@ -0,0 +1,21 @@ +/* Luma key simple program +Based on Edward Cannon's Simple Chroma Key (adaptation by Olive Team) +Feel free to modify and use at will */ + +uniform sampler2D tex; +varying vec2 vTexCoord; + +uniform float loc; +uniform float hic; + +void main(void) { + vec4 texture_color = texture2D(tex,vTexCoord); + + 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; + + texture_color.a = (luma >= loc && luma <= hic) ? luma : 0.0; + + gl_FragColor = texture_color; +} \ No newline at end of file diff --git a/effects/lumakey.xml b/effects/lumakey.xml new file mode 100644 index 000000000..03b933877 --- /dev/null +++ b/effects/lumakey.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file