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 colours 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 colour 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 |
Enables or disables color output. |
|
public get |
this get was deprecated. Use useRange instead.
Indicates whether luminance masking is enabled. |
|
public set |
this set was deprecated. Use useRange instead.
Enables or disables luminance masking. |
|
public |
|
|
public get |
The luminance threshold smoothing. |
|
public set |
Sets the luminance threshold smoothing. |
|
public get |
The luminance threshold. |
|
public set |
Sets the luminance threshold. |
|
public get |
Indicates whether luminance masking is enabled. |
|
public set |
Enables or disables luminance masking. |
|
public get |
Indicates whether the luminance threshold is enabled. |
|
public set |
Enables or disables the luminance threshold. |
Method Summary
Public Methods | ||
public |
setColorOutputEnabled(enabled: Boolean) this method was deprecated. Use colorOutput instead.
Enables or disables color output. |
|
public |
setLuminanceRangeEnabled(enabled: Boolean) this method was deprecated. Use luminanceRange instead.
Enables or disables the luminance mask. |
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 get luminanceRange: Boolean source
Indicates whether luminance masking is enabled.
public set luminanceRange: Boolean source
Enables or disables luminance masking.