new CSSShader()
The CSSShader constructor
- Source:
- css-shader.js, line 23
Members
-
<static> alphaCompositing :String
-
The alpha compositing mode to use
- Source:
- css-shader.js, line 84
- See:
-
- http://www.w3.org/TR/compositing/#alpha-compositing
-
<static> blendMode :String
-
The blend mode to use
- Source:
- css-shader.js, line 76
- See:
-
- http://www.w3.org/TR/compositing/#blend-mode
-
<static> fragmentShader :String
-
The fragment shader to be applied
- Source:
- css-shader.js, line 54
-
<static> paused :Boolean
-
Whether animation is paused
- Source:
- css-shader.js, line 40
-
<static> renderTarget :HTMLElement
-
The render target for the shaders
- Source:
- css-shader.js, line 61
-
<static> shaderArgs :Object
-
The optional user args for the shaders
- Source:
- css-shader.js, line 68
-
<static> vertexMesh :String
-
The vertex mesh to use. Defined as a string containing the number of rows, a space and the number of columns.
- Source:
- css-shader.js, line 93
- See:
-
- http://www.w3.org/TR/filter-effects/#vertexMesh-attribute
-
<static> vertexShader :String
-
The vertex shader to be applied
- Source:
- css-shader.js, line 47
Methods
-
<static> animate(time)
-
Uses RAF to animate the shaders on the render target.
Parameters:
Name Type Argument Description time
Number <optional>
The time arg to pass to the shaders - Source:
- css-shader.js, line 208
-
<static> pause()
-
Pauses an ongoing animation.
- Source:
- css-shader.js, line 219
-
<static> render(time)
-
Renders the shaders on the render target.
Parameters:
Name Type Argument Description time
Number <optional>
The time arg to pass to the shaders - Source:
- css-shader.js, line 178
-
<static> resume()
-
Resumes a paused animation.
- Source:
- css-shader.js, line 226
-
<static> setFragmentShader(shaderString)
-
Sets the fragment shader.
Parameters:
Name Type Description shaderString
String - Source:
- css-shader.js, line 130
-
<static> setFragmentShaderByNode(nodeOrId)
-
Takes a node by reference or it's id, and takes it's innerHTML as fragment shader.
Parameters:
Name Type Description nodeOrId
HTMLElement | String A node reference or a node id - Source:
- css-shader.js, line 121
-
<static> setRenderTarget(nodeOrId)
-
Takes a node by reference or id and uses it to apply the shaders to.
Parameters:
Name Type Description nodeOrId
HTMLElement | String A node reference or node id - Source:
- css-shader.js, line 169
-
<static> setShaderArg(id, value)
-
Sets a single shader arg
Parameters:
Name Type Description id
* The id (key) of the shader arg value
* The value of the shader arg - Source:
- css-shader.js, line 160
-
<static> setShaderArgs(args)
-
Sets the shader args. Note: will overwrite all current shader args.
Parameters:
Name Type Description args
Object A key-value map of shader args - Source:
- css-shader.js, line 150
-
<static> setVertexShader(shaderString)
-
Sets the vertex shader
Parameters:
Name Type Description shaderString
String - Source:
- css-shader.js, line 110
-
<static> setVertexShaderByNode(nodeOrId)
-
Takes a node by reference or it's id, and takes it's innerHTML as vertex shader.
Parameters:
Name Type Description nodeOrId
HTMLElement | String A node reference or a node id - Source:
- css-shader.js, line 101