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

TextureEffect

Extends:

three~EventDispatcherEffect → TextureEffect

Indirect Implements:

A texture effect.

Constructor Summary

Public Constructor
public

constructor(options: Object)

Constructs a new texture effect.

Member Summary

Public Members
public get
this get was deprecated. Use uvTransform instead for full control over the texture coordinates.

Indicates whether aspect correction is enabled.

public set
this set was deprecated. Use uvTransform instead for full control over the texture coordinates.

Enables or disables aspect correction.

public get

texture: Texture

The texture.

public set

texture: Texture

Sets the texture.

public get

Indicates whether the texture UV coordinates will be transformed using the transformation matrix of the texture.

public set

Enables or disables texture UV transformation.

Method Summary

Public Methods
public

Sets the swizzles that will be applied to the r, g, b, and a components of a texel before it is written to the output color.

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.

Public Constructors

public constructor(options: Object) source

Constructs a new texture effect.

Override:

Effect#constructor

Params:

NameTypeAttributeDescription
options Object
  • optional

The options.

options.blendFunction BlendFunction
  • optional
  • default: BlendFunction.NORMAL

The blend function of this effect.

options.texture Texture
  • optional

A texture.

options.aspectCorrection Boolean
  • optional
  • default: false

Deprecated. Enable uvTransform instead and adjust the texture's offset, repeat and center.

Public Members

public get aspectCorrection: Number source

this get was deprecated. Use uvTransform instead for full control over the texture coordinates.

Indicates whether aspect correction is enabled.

If enabled, the texture can be scaled using the scale uniform.

public set aspectCorrection: Number source

this set was deprecated. Use uvTransform instead for full control over the texture coordinates.

Enables or disables aspect correction.

public get texture: Texture source

The texture.

public set texture: Texture source

Sets the texture.

public get uvTransform: Boolean source

Indicates whether the texture UV coordinates will be transformed using the transformation matrix of the texture.

Cannot be used if aspect correction is enabled.

public set uvTransform: Boolean source

Enables or disables texture UV transformation.

Public Methods

public setTextureSwizzleRGBA(r: ColorChannel, g: ColorChannel, b: ColorChannel, a: ColorChannel) source

Sets the swizzles that will be applied to the r, g, b, and a components of a texel before it is written to the output color.

Params:

NameTypeAttributeDescription
r ColorChannel

The swizzle for the r component.

g ColorChannel
  • optional
  • default: r

The swizzle for the g component.

b ColorChannel
  • optional
  • default: r

The swizzle for the b component.

a ColorChannel
  • optional
  • default: r

The swizzle for the a component.

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.