HTML5 Canvas 2D Library
 

ssc Library Method

Short Description: Creates a new shader configuration object

Signature: taccgl.ssc (id)
Class: taccgl Class
 

Creates a new shader configuration object. Read taccglShaderConfig Class for an introduction about shader configuration objects.

id must denote the id of an HTML script tag that contains the custom shader program code. Refer to ShaderGeneration .

Examples

var s=taccgl.ssc("ShaderExample").times();
var b=taccgl.actor("testimg").sc(s).dur(2).start();
RUN
var s=taccgl.ssc("ShaderExample").times();
var a=taccgl.actor("pgMiddleColumnTable").sc(s).dur(10).start();
var b=taccgl.actor("testimg").sc(s).dur(5).showAfter().start();
RUN
<script id="ShaderExample" type="x-gsgl/x-shader">
:color
float p=fract(s*2.0)*2.0-1.0;
float q=fract(t*2.0)*2.0-1.0;
if (p*p+q*q > ((4.0-ct)*(4.0-ct)/16.0)) a=0.0;
</script>
 

WebGL™ is a trademark of the Khronos Group Inc.

Next Page:taccgl.ddmode - Returns if 2D or 3D canvas is used
Previous Page: taccgl.setEndStyle - Controls style of 3D canvas at end of animation
Please Add a Comment or Question, click here!