SMAAEffect
Extends:
Indirect Implements:
Subpixel Morphological Antialiasing (SMAA) v2.8.
Preset: SMAA 1x Medium (with color edge detection). https://github.com/iryoku/smaa/releases/tag/v2.8
Static Member Summary
Static Public Members | ||
public static get |
The SMAA area image, encoded as a base64 data URL. |
|
public static get |
The SMAA search image, encoded as a base64 data URL. |
Constructor Summary
Public Constructor | ||
public |
constructor(searchImage: Image, areaImage: Image) Constructs a new SMAA effect. |
Member Summary
Private Members | ||
private |
A clear pass for the color edges buffer. |
|
private |
A color edge detection pass. |
|
private |
renderTargetColorEdges: WebGLRenderTarget A render target for the color edge detection. |
|
private |
renderTargetWeights: WebGLRenderTarget A render target for the SMAA weights. |
|
private |
An SMAA weights pass. |
Method Summary
Public Methods | ||
public |
setEdgeDetectionThreshold(threshold: Number) Sets the edge detection sensitivity. |
|
public |
setOrthogonalSearchSteps(steps: Number) Sets the maximum amount of horizontal/vertical search steps. |
|
public |
Updates the size of internal render targets. |
|
public |
Updates this effect. |
Inherited Summary
From class Effect | ||
public |
[key]: * |
|
public |
The effect attributes. |
|
public |
The blend mode of this effect. |
|
public |
Preprocessor macro definitions. |
|
public |
WebGL extensions that are required by this effect. |
|
public |
The fragment shader. |
|
public |
The name of this effect. |
|
public |
Shader uniforms. |
|
public |
The vertex shader. |
|
public |
dispose() Performs a shallow search for properties that define a dispose method and deletes them. |
|
public |
initialize(renderer: WebGLRenderer, alpha: Boolean) Performs initialization tasks. |
|
public |
setDepthTexture(depthTexture: Texture, depthPacking: Number) Sets the depth texture. |
|
public |
Updates the size of this effect. |
|
public |
Updates the effect by performing supporting operations. |
Static Public Members
public static get areaImageDataURL: String source
The SMAA area image, encoded as a base64 data URL.
Use this image data to create an Image instance and use it together with the search image to create an SMAAEffect.
Example:
const areaImage = new Image();
areaImage.addEventListener("load", progress);
areaImage.src = SMAAEffect.areaImageDataURL;
public static get searchImageDataURL: String source
The SMAA search image, encoded as a base64 data URL.
Use this image data to create an Image instance and use it together with the area image to create an SMAAEffect.
Example:
const searchImage = new Image();
searchImage.addEventListener("load", progress);
searchImage.src = SMAAEffect.searchImageDataURL;
Public Constructors
public constructor(searchImage: Image, areaImage: Image) source
Constructs a new SMAA effect.
Override:
Effect#constructorParams:
Name | Type | Attribute | Description |
searchImage | Image | The SMAA search image. Preload this image using the searchImageDataURL. |
|
areaImage | Image | The SMAA area image. Preload this image using the areaImageDataURL. |
Private Members
private renderTargetColorEdges: WebGLRenderTarget source
A render target for the color edge detection.
Public Methods
public setEdgeDetectionThreshold(threshold: Number) source
Sets the edge detection sensitivity.
See ColorEdgesMaterial#setEdgeDetectionThreshold for more details.
Params:
Name | Type | Attribute | Description |
threshold | Number | The edge detection sensitivity. Range: [0.05, 0.5]. |
public setOrthogonalSearchSteps(steps: Number) source
Sets the maximum amount of horizontal/vertical search steps.
See SMAAWeightsMaterial#setOrthogonalSearchSteps for more details.
Params:
Name | Type | Attribute | Description |
steps | Number | The search steps. Range: [0, 112]. |
public setSize(width: Number, height: Number) source
Updates the size of internal render targets.
Override:
Effect#setSizepublic update(renderer: WebGLRenderer, inputBuffer: WebGLRenderTarget, delta: Number) source
Updates this effect.
Override:
Effect#updateParams:
Name | Type | Attribute | Description |
renderer | WebGLRenderer | The renderer. |
|
inputBuffer | WebGLRenderTarget | A frame buffer that contains the result of the previous pass. |
|
delta | Number |
|
The time between the last frame and the current one in seconds. |