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

EffectMaterial

Extends:

three~ShaderMaterial → EffectMaterial

Implements:

An effect material for compound shaders.

This material supports dithering.

Constructor Summary

Public Constructor
public

constructor(shaderParts: Map<String, String>, defines: Map<String, String>, uniforms: Map<String, Uniform>, camera: Camera, dithering: Boolean)

Constructs a new effect material.

Member Summary

Public Members
public get

The current depth packing.

public set

Sets the depth packing.

public
public
public

Method Summary

Public Methods
public

adoptCameraSettings(camera: Camera)

Adopts the settings of the given camera.

public

Sets the shader macros.

public

Sets the shader parts.

public

setSize(width: Number, height: Number)

Sets the resolution.

public

setUniforms(uniforms: Map<String, Uniform>): EffectMaterial

Sets the shader uniforms.

Public Constructors

public constructor(shaderParts: Map<String, String>, defines: Map<String, String>, uniforms: Map<String, Uniform>, camera: Camera, dithering: Boolean) source

Constructs a new effect material.

Params:

NameTypeAttributeDescription
shaderParts Map<String, String>
  • optional
  • default: null

A collection of shader snippets. See Section.

defines Map<String, String>
  • optional
  • default: null

A collection of preprocessor macro definitions.

uniforms Map<String, Uniform>
  • optional
  • default: null

A collection of uniforms.

camera Camera
  • optional

A camera.

dithering Boolean
  • optional
  • default: false

Whether dithering should be enabled.

Public Members

public get depthPacking: Number source

The current depth packing.

public set depthPacking: Number source

Sets the depth packing.

Use BasicDepthPacking or RGBADepthPacking if your depth texture contains packed depth.

public fragmentShader: * source

public needsUpdate: boolean source

public vertexShader: * source

Public Methods

public adoptCameraSettings(camera: Camera) source

Adopts the settings of the given camera.

Params:

NameTypeAttributeDescription
camera Camera
  • optional
  • default: null

A camera.

public setDefines(defines: Map<String, String>): EffectMaterial source

Sets the shader macros.

Params:

NameTypeAttributeDescription
defines Map<String, String>

A collection of preprocessor macro definitions.

Return:

EffectMaterial

This material.

public setShaderParts(shaderParts: Map<String, String>): EffectMaterial source

Sets the shader parts.

Params:

NameTypeAttributeDescription
shaderParts Map<String, String>

A collection of shader snippets. See Section.

Return:

EffectMaterial

This material.

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

Sets the resolution.

Params:

NameTypeAttributeDescription
width Number

The width.

height Number

The height.

public setUniforms(uniforms: Map<String, Uniform>): EffectMaterial source

Sets the shader uniforms.

Params:

NameTypeAttributeDescription
uniforms Map<String, Uniform>

A collection of uniforms.

Return:

EffectMaterial

This material.