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 gl
WebGLRenderingContext WebGL context
- Source:
Returns:
GLSL function definition
- Type
- string | null
-
getSampler(name)
-
Finds a sampler by name
Parameters:
Name Type Description name
string 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 mode
string Mode category to modify
id
string 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 name
string Base name of uniform variable
value
number | 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 id
string Unique identifier for the mode
enable
boolean Whether the mode is active
src
string GLSL source code for the mode
-
Sampler
-
A texture sampler used by the filter
Type:
- Object
- Source:
Properties:
Name Type Argument Description name
string Unique name for the sampler
texture
WebGLTexture <optional>
Associated WebGL texture
location
WebGLUniformLocation <optional>
GPU location for the sampler