Home Reference Source
import {EffectMaterial} from 'postprocessing/src/materials/EffectMaterial.js'
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.

Method Summary

Public Methods
public

adoptCameraSettings(camera: Camera)

Adopts the settings of the given camera.

public

setSize(width: Number, height: Number)

Sets the resolution.

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>

A collection of shader snippets.

defines Map<String, String>

A collection of preprocessor macro definitions.

uniforms Map<String, Uniform>

A collection of uniforms.

camera Camera
  • optional
  • default: null

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.

You'll need to call EffectPass#recompile after changing this value.

Public Methods

public adoptCameraSettings(camera: Camera) source

Adopts the settings of the given camera.

Params:

NameTypeAttributeDescription
camera Camera
  • optional
  • default: null

A camera.

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

Sets the resolution.

Params:

NameTypeAttributeDescription
width Number

The width.

height Number

The height.