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

ColorEdgesMaterial

Extends:

three~ShaderMaterial → ColorEdgesMaterial
this class was deprecated. Use EdgeDetectionMaterial instead.

A material that detects edges in a color texture.

Constructor Summary

Public Constructor
public

constructor(texelSize: Vector2)

Constructs a new color edges material.

Member Summary

Public Members
public

Method Summary

Public Methods
public

Sets the edge detection sensitivity.

public

Sets the local contrast adaptation factor.

Public Constructors

public constructor(texelSize: Vector2) source

Constructs a new color edges material.

Params:

NameTypeAttributeDescription
texelSize Vector2
  • optional

The absolute screen texel size.

Public Members

public needsUpdate: boolean source

Public Methods

public setEdgeDetectionThreshold(threshold: Number) source

Sets the edge detection sensitivity.

A lower value results in more edges being detected at the expense of performance.

0.1 is a reasonable value, and allows to catch most visible edges. 0.05 is a rather overkill value, that allows to catch 'em all.

If temporal supersampling is used, 0.2 could be a reasonable value, as low contrast edges are properly filtered by just 2x.

Params:

NameTypeAttributeDescription
threshold Number

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

public setLocalContrastAdaptationFactor(factor: Number) source

Sets the local contrast adaptation factor.

If there is a neighbor edge that has factor times bigger contrast than the current edge, the edge will be discarded.

This allows to eliminate spurious crossing edges and is based on the fact that if there is too much contrast in a direction, the perceptual contrast in the other neighbors will be hidden.

Params:

NameTypeAttributeDescription
factor Number

The local contrast adaptation factor. Default is 2.0.