HTML5 Canvas 3D WebGL (TM) javaScript Library

color Library Method

Signature: sc.color ()
Class: taccglShaderConfig Class

This is initially an empty method that you can override to customize the fragment shader. The code can modify the variable col which contains the color of the current fragment (as vec3) or a which contains its opacity. The shader already blended both texture canvases and the directly specified color leading to col and a. Afterwards still lighting calculations will be applied to col and a.

By assigning a=0.0, i.e. making a fragment transparent, the fragment can effectively be deleted. Note that col contains the color in premultiplied alpha form, so all color values must be in the range from 0.0 to a.


var s=taccgl.ssc('ShaderSample2');var"testimg").sc(s).dur(2).start();
<script id="ShaderSample2" type="x-gsgl/x-shader">
col = vec3(1.0,1.0,1.0)*a-col;
var s=taccgl.ssc('ShaderSample3').times().dynTex(); var;
<script id="ShaderSample3" type="x-gsgl/x-shader">
if (s*t>ct/4.0) a=0.0;

WebGL™ is a trademark of the Khronos Group Inc.