Home Reference Source
import {SMAAEffect} from 'postprocessing'
public class | source

SMAAEffect

Extends:

three~EventDispatcherEffect → SMAAEffect

Indirect Implements:

Subpixel Morphological Antialiasing (SMAA).

https://github.com/iryoku/smaa/releases/tag/v2.8

Static Member Summary

Static Public Members
public static get
this get was deprecated. Use SMAAImageLoader instead.

The SMAA area image, encoded as a base64 data URL.

public static get
this get was deprecated. Use SMAAImageLoader instead.

The SMAA search image, encoded as a base64 data URL.

Constructor Summary

Public Constructor
public

constructor(searchImage: Image, areaImage: Image, preset: SMAAPreset, edgeDetectionMode: EdgeDetectionMode)

Constructs a new SMAA effect.

Member Summary

Public Members
public get
this get was deprecated. Use edgeDetectionMaterial instead.

The internal edge detection material.

public get

The internal edge detection material.

public get

The internal edge weights material.

Method Summary

Public Methods
public

Applies the given quality preset.

public

Deletes internal render targets and textures.

public

setDepthTexture(depthTexture: Texture, depthPacking: Number)

Sets the depth texture.

public
this method was deprecated. Use applyPreset or edgeDetectionMaterial instead.

Sets the edge detection sensitivity.

public
this method was deprecated. Use applyPreset or weightsMaterial instead.

Sets the maximum amount of horizontal/vertical search steps.

public

setSize(width: Number, height: Number)

Updates the size of internal render targets.

public

update(renderer: WebGLRenderer, inputBuffer: WebGLRenderTarget, deltaTime: Number)

Updates this effect.

Inherited Summary

From class Effect
public

The blend mode of this effect.

public

Preprocessor macro definitions.

public

WebGL extensions that are required by this effect.

public

The name of this effect.

public

uniforms: Map<String, Uniform>

Shader uniforms.

public

Performs a shallow search for properties that define a dispose method and deletes them.

public

Returns the effect attributes.

public

Returns the fragment shader.

public

Returns the vertex shader.

public

initialize(renderer: WebGLRenderer, alpha: Boolean, frameBufferType: Number)

Performs initialization tasks.

public

setDepthTexture(depthTexture: Texture, depthPacking: Number)

Sets the depth texture.

public

setSize(width: Number, height: Number)

Updates the size of this effect.

public

update(renderer: WebGLRenderer, inputBuffer: WebGLRenderTarget, deltaTime: Number)

Updates the effect by performing supporting operations.

protected

Sets the effect attributes.

protected

Informs the associated EffectPass that this effect has changed in a way that requires a shader recompilation.

protected

setFragmentShader(fragmentShader: String)

Sets the fragment shader.

protected

setVertexShader(vertexShader: String)

Sets the vertex shader.

Static Public Members

public static get areaImageDataURL: String source

this get was deprecated. Use SMAAImageLoader instead.

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

this get was deprecated. Use SMAAImageLoader instead.

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, preset: SMAAPreset, edgeDetectionMode: EdgeDetectionMode) source

Constructs a new SMAA effect.

Override:

Effect#constructor

Params:

NameTypeAttributeDescription
searchImage Image

The SMAA search image. Preload this image using the SMAAImageLoader.

areaImage Image

The SMAA area image. Preload this image using the SMAAImageLoader.

preset SMAAPreset
  • optional
  • default: SMAAPreset.HIGH

An SMAA quality preset.

edgeDetectionMode EdgeDetectionMode
  • optional
  • default: EdgeDetectionMode.COLOR

The edge detection mode.

Public Members

public get colorEdgesMaterial: EdgeDetectionMaterial source

this get was deprecated. Use edgeDetectionMaterial instead.

The internal edge detection material.

public get edgeDetectionMaterial: EdgeDetectionMaterial source

The internal edge detection material.

public get weightsMaterial: SMAAWeightsMaterial source

The internal edge weights material.

Public Methods

public applyPreset(preset: SMAAPreset) source

Applies the given quality preset.

Params:

NameTypeAttributeDescription
preset SMAAPreset

The preset.

public dispose() source

Deletes internal render targets and textures.

Override:

Effect#dispose

public setDepthTexture(depthTexture: Texture, depthPacking: Number) source

Sets the depth texture.

Override:

Effect#setDepthTexture

Params:

NameTypeAttributeDescription
depthTexture Texture

A depth texture.

depthPacking Number
  • optional
  • default: BasicDepthPacking

The depth packing.

public setEdgeDetectionThreshold(threshold: Number) source

this method was deprecated. Use applyPreset or edgeDetectionMaterial instead.

Sets the edge detection sensitivity.

See EdgeDetectionMaterial#setEdgeDetectionThreshold for more details.

Params:

NameTypeAttributeDescription
threshold Number

The edge detection sensitivity. Range: [0.05, 0.5].

public setOrthogonalSearchSteps(steps: Number) source

this method was deprecated. Use applyPreset or weightsMaterial instead.

Sets the maximum amount of horizontal/vertical search steps.

See SMAAWeightsMaterial#setOrthogonalSearchSteps for more details.

Params:

NameTypeAttributeDescription
steps Number

The search steps. Range: [0, 112].

public setSize(width: Number, height: Number) source

Updates the size of internal render targets.

Override:

Effect#setSize

Params:

NameTypeAttributeDescription
width Number

The width.

height Number

The height.

public update(renderer: WebGLRenderer, inputBuffer: WebGLRenderTarget, deltaTime: Number) source

Updates this effect.

Override:

Effect#update

Params:

NameTypeAttributeDescription
renderer WebGLRenderer

The renderer.

inputBuffer WebGLRenderTarget

A frame buffer that contains the result of the previous pass.

deltaTime Number
  • optional

The time between the last frame and the current one in seconds.