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

SMAAImageGenerator

An SMAA image generator.

This class uses a worker thread to generate the search and area images. The generated data URLs will be cached using localStorage, if available. To disable caching use SMAAImageGenerator.setCacheEnabled.

Constructor Summary

Public Constructor
public

Constructs a new SMAA image generator.

Member Summary

Public Members
public
this member was deprecated. Use setCacheEnabled() instead.

Indicates whether data image caching is disabled.

Method Summary

Public Methods
public

generate(): Promise<Image[]>

Generates the SMAA data images.

public

Enables or disables caching via localStorage.

Public Constructors

public constructor() source

Constructs a new SMAA image generator.

Public Members

public disableCache: Boolean source

this member was deprecated. Use setCacheEnabled() instead.

Indicates whether data image caching is disabled.

Public Methods

public generate(): Promise<Image[]> source

Generates the SMAA data images.

Return:

Promise<Image[]>

A promise that returns the search image and area image as a pair.

Example:

SMAAImageGenerator.generate().then(([search, area]) => {
  const smaaEffect = new SMAAEffect(search, area);
});

public setCacheEnabled(value: Boolean) source

Enables or disables caching via localStorage.

Params:

NameTypeAttributeDescription
value Boolean

Whether the cache should be enabled.