new ShaderFilter( [options])
Creates a new shader filter
Parameters:
| Name | Type | Argument | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Filter configuration Properties
|
- Source:
Methods
-
<abstract> fragDataSrc(gl)
-
Generates filter-specific GLSL function
Parameters:
Name Type Description glWebGLRenderingContext WebGL context
- Source:
Returns:
GLSL function definition
- Type
- string | null
-
getSampler(name)
-
Finds a sampler by name
Parameters:
Name Type Description namestring Base sampler name
- Source:
Returns:
Found sampler or undefined
- Type
- ShaderFilter~Sampler | undefined
-
setMode(mode, id)
-
Sets the active mode for the filter
Parameters:
Name Type Description modestring Mode category to modify
idstring Specific mode ID to enable
- Source:
Throws:
-
If shader not registered or mode doesn't exist
- Type
- Error
-
setUniform(name, value)
-
Sets a uniform variable value
Parameters:
Name Type Description namestring Base name of uniform variable
valuenumber | boolean | Array Value to set
- Source:
Throws:
-
If shader not registered
- Type
- Error
Type Definitions
-
Mode
-
A shader filter mode configuration
Type:
- Object
- Source:
Properties:
Name Type Description idstring Unique identifier for the mode
enableboolean Whether the mode is active
srcstring GLSL source code for the mode
-
Sampler
-
A texture sampler used by the filter
Type:
- Object
- Source:
Properties:
Name Type Argument Description namestring Unique name for the sampler
textureWebGLTexture <optional>
Associated WebGL texture
locationWebGLUniformLocation <optional>
GPU location for the sampler