EdgeDetectionMaterial
Extends:
Implements:
An edge detection material. Mainly used for SMAA.
Constructor Summary
Public Constructor | ||
public |
constructor(texelSize: Vector2, mode: EdgeDetectionMode) Constructs a new edge detection material. |
Member Summary
Public Members | ||
public set |
depthBuffer: Texture The depth buffer. |
|
public set |
depthPacking: DepthPackingStrategies The depth packing strategy. |
|
public get |
The edge detection mode. |
|
public set |
|
|
public get |
The edge detection threshold. |
|
public set |
|
|
public get |
The local contrast adaptation factor. |
|
public set |
|
|
public |
|
|
public set |
predicationBuffer: Texture The predication buffer. |
|
public get |
The predication mode. |
|
public set |
|
|
public get |
predicationScale: Boolean | Texture | Number The predication scale. |
|
public set |
|
|
public get |
The predication strength. |
|
public set |
|
|
public get |
The predication threshold. |
|
public set |
|
Method Summary
Public Methods | ||
public |
this method was deprecated. Use edgeDetectionMode instead.
Returns the edge detection mode. |
|
public |
this method was deprecated. Use edgeDetectionThreshold instead.
Returns the edge detection threshold. |
|
public |
this method was deprecated. Use localContrastAdaptationFactor instead.
Returns the local contrast adaptation factor. |
|
public |
this method was deprecated. Use predicationMode instead.
Returns the predication mode. |
|
public |
this method was deprecated. Use predicationScale instead.
Returns the predication scale. |
|
public |
this method was deprecated. Use predicationStrength instead.
Returns the predication strength. |
|
public |
this method was deprecated. Use predicationThreshold instead.
Returns the predication threshold. |
|
public |
setDepthBuffer(buffer: Texture, depthPacking: DepthPackingStrategies) this method was deprecated. Use depthBuffer and depthPacking instead.
Sets the depth buffer. |
|
public |
this method was deprecated. Use edgeDetectionMode instead.
Sets the edge detection mode. |
|
public |
setEdgeDetectionThreshold(value: Number) this method was deprecated. Use edgeDetectionThreshold instead.
Sets the edge detection threshold. |
|
public |
this method was deprecated. Use localContrastAdaptationFactor instead.
Sets the local contrast adaptation factor. |
|
public |
setPredicationBuffer(value: Texture) this method was deprecated. Use predicationBuffer instead.
Sets a custom predication buffer. |
|
public |
setPredicationMode(value: PredicationMode) this method was deprecated. Use predicationMode instead.
Sets the predication mode. |
|
public |
setPredicationScale(value: Number) this method was deprecated. Use predicationScale instead.
Sets the predication scale. |
|
public |
setPredicationStrength(value: Number) this method was deprecated. Use predicationStrength instead.
Sets the predication strength. |
|
public |
setPredicationThreshold(value: Number) this method was deprecated. Use predicationThreshold instead.
Sets the predication threshold. |
|
public |
Sets the size of this object. |
Public Constructors
public constructor(texelSize: Vector2, mode: EdgeDetectionMode) source
Constructs a new edge detection material.
TODO Remove parameters.
Params:
Name | Type | Attribute | Description |
texelSize | Vector2 |
|
The screen texel size. |
mode | EdgeDetectionMode |
|
The edge detection mode. |
Public Members
public set edgeDetectionMode source
public get edgeDetectionThreshold: Number source
The edge detection threshold. Range: [0.0, 0.5].
A lower value results in more edges being detected at the expense of performance.
For luma- and chroma-based edge detection, 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. Darker scenes may require an even lower threshold.
If depth-based edge detection is used, the threshold will depend on the scene depth.
public set edgeDetectionThreshold source
public get localContrastAdaptationFactor: Number source
The local contrast adaptation factor. Has no effect if the edge detection mode is set to DEPTH. Default is 2.0.
If a neighbor edge 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.
public set localContrastAdaptationFactor source
public get predicationMode: PredicationMode source
The predication mode.
Predicated thresholding allows to better preserve texture details and to improve edge detection using an additional buffer such as a light accumulation or depth buffer.
public set predicationMode source
public get predicationScale: Boolean | Texture | Number source
The predication scale. Range: [1.0, 5.0].
Determines how much the edge detection threshold should be scaled when using predication.
public set predicationScale source
public get predicationStrength: Number source
The predication strength. Range: [0.0, 1.0].
Determines how much the edge detection threshold should be decreased locally when using predication.
public set predicationStrength source
public set predicationThreshold source
Public Methods
public getEdgeDetectionMode(): EdgeDetectionMode source
Returns the edge detection mode.
public getEdgeDetectionThreshold(): Number source
Returns the edge detection threshold.
public getLocalContrastAdaptationFactor(): Number source
Returns the local contrast adaptation factor.
public getPredicationMode(): PredicationMode source
Returns the predication mode.
public getPredicationScale(): Number source
Returns the predication scale.
public getPredicationStrength(): Number source
Returns the predication strength.
public getPredicationThreshold(): Number source
Returns the predication threshold.
public setDepthBuffer(buffer: Texture, depthPacking: DepthPackingStrategies) source
Sets the depth buffer.
Params:
Name | Type | Attribute | Description |
buffer | Texture | The depth texture. |
|
depthPacking | DepthPackingStrategies |
|
The depth packing strategy. |
public setEdgeDetectionMode(value: EdgeDetectionMode) source
Sets the edge detection mode.
Params:
Name | Type | Attribute | Description |
value | EdgeDetectionMode | The edge detection mode. |
public setEdgeDetectionThreshold(value: Number) source
Sets the edge detection threshold.
Params:
Name | Type | Attribute | Description |
value | Number | The edge detection threshold. Range: [0.0, 0.5]. |
public setLocalContrastAdaptationFactor(value: Number) source
Sets the local contrast adaptation factor. Has no effect if the edge detection mode is set to DEPTH.
Params:
Name | Type | Attribute | Description |
value | Number | The local contrast adaptation factor. Default is 2.0. |
public setPredicationBuffer(value: Texture) source
Sets a custom predication buffer.
Params:
Name | Type | Attribute | Description |
value | Texture | The predication buffer. |
public setPredicationMode(value: PredicationMode) source
Sets the predication mode.
Params:
Name | Type | Attribute | Description |
value | PredicationMode | The predication mode. |
public setPredicationScale(value: Number) source
Sets the predication scale.
Params:
Name | Type | Attribute | Description |
value | Number | The scale. Range: [1.0, 5.0]. |
public setPredicationStrength(value: Number) source
Sets the predication strength.
Params:
Name | Type | Attribute | Description |
value | Number | The strength. Range: [0.0, 1.0]. |