HTML5 Canvas 2D Library
 

mix Library Method

Signature: sc.mix ()
Class: taccglShaderConfig Class
 

This is initially an empty method that you can override to customize the fragment shader. The code can modify the variables c,d,ca,da. c and d contain the color and opacity of the corresponding pixel on the first and second texture canvas. ca and da are scalar factors specifying to what portion c and d are blended later on.

Examples

var s=taccgl.ssc('ShaderSample4').times().dynTex(); var b=taccgl.actor("testimg").sc(s).dur(2);
taccgl.texTo(2);taccgl.paintElement("testimg2",true);
b.start()
RUN
<script id="ShaderSample4" type="x-gsgl/x-shader">
:mix
da = clamp (s-0.7+ct/1.0,0.0,1.0); ca=1.0;
</script>