LuminanceMaterial
Extends:
A luminance shader material.
This shader produces a greyscale luminance map that describes the absolute amount of light emitted by a scene. It can also be configured to output colors that are scaled with their respective luminance value. Additionally, a range may be provided to mask out undesired texels.
The alpha channel always contains the luminance value.
On luminance coefficients: http://www.poynton.com/notes/colour_and_gamma/ColorFAQ.html#RTFToC9
Coefficients for different color spaces: https://hsto.org/getpro/habr/post_images/2ab/69d/084/2ab69d084f9a597e032624bcd74d57a7.png
Luminance range reference: https://cycling74.com/2007/05/23/your-first-shader/#.Vty9FfkrL4Z
Constructor Summary
Public Constructor | ||
public |
constructor(colorOutput: Boolean, luminanceRange: Vector2) Constructs a new luminance material. |
Member Summary
Public Members | ||
public get |
Indicates whether color output is enabled. |
|
public set |
|
|
public set |
inputBuffer: Texture The input buffer. |
|
public get |
The luminance range. |
|
public set |
|
|
public |
|
|
public get |
The luminance threshold smoothing. |
|
public set |
|
|
public get |
The luminance threshold. |
|
public set |
|
|
public get |
this get was deprecated.
Indicates whether luminance masking is enabled. |
|
public set |
|
|
public get |
this get was deprecated. Adjust the threshold or smoothing factor instead.
Indicates whether the luminance threshold is enabled. |
|
public set |
|
Method Summary
Public Methods | ||
public |
getLuminanceRange(): Vector2 this method was deprecated. Use luminanceRange instead.
Returns the current luminance range. |
|
public |
this method was deprecated. Use smoothing instead.
Returns the luminance threshold smoothing factor. |
|
public |
this method was deprecated. Use threshold instead.
Returns the luminance threshold. |
|
public |
isColorOutputEnabled(value: *): Boolean this method was deprecated. Use colorOutput instead.
Indicates whether color output is enabled. |
|
public |
setColorOutputEnabled(value: Boolean) this method was deprecated. Use colorOutput instead.
Enables or disables color output. |
|
public |
setInputBuffer(value: Texture) this method was deprecated. Use inputBuffer instead.
Sets the input buffer. |
|
public |
setLuminanceRange(value: Vector2) this method was deprecated. Use luminanceRange instead.
Sets a luminance range. |
|
public |
setSmoothingFactor(value: Number) this method was deprecated. Use smoothing instead.
Sets the luminance threshold smoothing factor. |
|
public |
setThreshold(value: Number) this method was deprecated. Use threshold instead.
Sets the luminance threshold. |
Public Constructors
public constructor(colorOutput: Boolean, luminanceRange: Vector2) source
Constructs a new luminance material.
Params:
Name | Type | Attribute | Description |
colorOutput | Boolean |
|
Defines whether the shader should output colors scaled with their luminance value. |
luminanceRange | Vector2 |
|
If provided, the shader will mask out texels that aren't in the specified luminance range. |
Public Members
public set colorOutput source
public set luminanceRange source
public set smoothing source
public set threshold source
public get useRange: Boolean source
Indicates whether luminance masking is enabled.
public set useRange source
public get useThreshold: Boolean source
Indicates whether the luminance threshold is enabled.
public set useThreshold source
Public Methods
public getLuminanceRange(): Vector2 source
Returns the current luminance range.
Return:
Vector2 | The luminance range. |
public getSmoothingFactor(): Number source
Returns the luminance threshold smoothing factor.
public getThreshold(): Number source
Returns the luminance threshold.
public isColorOutputEnabled(value: *): Boolean source
Indicates whether color output is enabled.
Params:
Name | Type | Attribute | Description |
value | * |
public setColorOutputEnabled(value: Boolean) source
Enables or disables color output.
Params:
Name | Type | Attribute | Description |
value | Boolean | Whether color output should be enabled. |
public setInputBuffer(value: Texture) source
Sets the input buffer.
Params:
Name | Type | Attribute | Description |
value | Texture | The input buffer. |
public setLuminanceRange(value: Vector2) source
Sets a luminance range. Set to null to disable.
Params:
Name | Type | Attribute | Description |
value | Vector2 | The luminance range. |