~npisanti/scriptools

c7b39ccf5625397e0d96b608b9a9c28c86a8a9cb — Nicola Pisanti 29 days ago f1560ce
cereal example is an alpha masker now
1 files changed, 3 insertions(+), 13 deletions(-)

M cereal/process.frag
M cereal/process.frag => cereal/process.frag +3 -13
@@ 5,22 5,12 @@ precision highp float;

uniform vec2 u_resolution;
uniform float u_time;
uniform sampler2D u_tex0;
uniform sampler2D u_tex_fb;

void main(){
    vec2 st = gl_FragCoord.xy/u_resolution;
    
	st.x += 0.4;
	
    vec4 source = texture2D( texture0, st ); // for texture access
    vec3 color = source.rgb;
    float luminance = color.r*0.299 + color.g*0.587 + color.b*0.114;	

    float low = 0.15;
    float high = 0.45;
    
    float alpha = smoothstep( low, high, luminance );
    vec4 source = texture2D( u_tex_fb, st ); // for texture access
    
    gl_FragColor = vec4( vec3(alpha), 1.0 );
    // gl_FragColor = vec4( 1.0, 1.0, 1.0, alpha );
    gl_FragColor = vec4( vec3(1.0), 1.0 - source.r );
}