Name | Type | Description |
---|---|---|
options |
BlurFilterPassOptions | |
options.horizontal |
Do pass along the x-axis ( |
|
options.strength |
The strength of the blur filter. |
|
options.quality |
The quality of the blur filter. |
|
options.kernelSize |
The kernelSize of the blur filter.Options: 5, 7, 9, 11, 13, 15. |
Extends
Members
defaultOptions Partial<BlurFilterPassOptions> static
Default blur filter pass options
Properties:
Name | Type | Default | Description |
---|---|---|---|
kernelSize |
number |
5
|
The kernelSize of the blur filter.Options: 5, 7, 9, 11, 13, 15. |
quality |
number |
4
|
The quality of the blur filter. |
strength |
number |
8
|
The strength of the blur filter. |
Sets the strength of both the blur.
- Default Value:
- 16
Do pass along the x-axis (true
) or y-axis (false
).
The number of passes to run the filter.
Sets the quality of the blur by modifying the number of passes. More passes means higher quality blurring but the lower the performance.
- Default Value:
- 4
The strength of the blur filter.
Methods
Applies the filter.
Name | Type | Description |
---|---|---|
filterManager |
FilterSystem |
The manager. |
input |
Texture |
The input target. |
output |
RenderSurface |
The output target. |
clearMode |
boolean |
How to clear |
Inherited Properties
From class Filter
antialias FilterAntialias inherited
should the filter use antialiasing?
- Default Value:
- inherit
blendMode BLEND_MODES inherited overrides
Get the blend mode of the filter.
- Default Value:
- "normal"
blendRequired boolean inherited
Whether or not this filter requires the previous render texture for blending.
- Default Value:
- false
clipToViewport boolean inherited
Clip texture into viewport or not
- Default Value:
- true
enabled boolean inherited
If enabled is true the filter is applied, if false it will not.
- Default Value:
- true
padding number inherited
The padding of the filter. Some filters require extra space to breath such as a blur. Increasing this will add extra width and height to the bounds of the object that the filter is applied to.
- Default Value:
- 0
resolution number | "inherit" inherited
The resolution of the filter. Setting this to be lower will lower the quality but increase the performance of the filter.
- Default Value:
- 1
From class Shader
compatibleRenderers number readonly inherited
A number that uses two bits on whether the shader is compatible with the WebGL renderer and/or the WebGPU renderer. 0b00 - not compatible with either 0b01 - compatible with WebGL 0b10 - compatible with WebGPU This is automatically set based on if a GlProgram or {@link GpuProgram} is provided.
An instance of the GL program used by the WebGL renderer
gpuProgram GpuProgram inherited
An instance of the GPU program used by the WebGPU renderer
resources Record<string, any> inherited
A record of the resources used by the shader.
uid number readonly inherited
A unique identifier for the shader
Inherited Methods
From class Shader
Sometimes a resource group will be provided later (for example global uniforms) In such cases, this method can be used to let the shader know about the group.
Name | Type | Description |
---|---|---|
name |
string |
the name of the resource group |
groupIndex |
number |
the index of the group (should match the webGPU shader group location) |
bindIndex |
number |
the index of the bind point (should match the webGPU shader bind point) |
Use to destroy the shader when its not longer needed. It will destroy the resources and remove listeners.
Name | Type | Default | Description |
---|---|---|---|
destroyPrograms |
boolean | false |
if the programs should be destroyed as well. Make sure its not being used by other shaders! |