import {LuminosityMaterial} from 'postprocessing/src/materials/LuminosityMaterial.js'
LuminosityMaterial
Extends:
A luminosity 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 will remain unaffected in all cases.
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 luminosity material. |
Member Summary
Public Members | ||
public |
|
Method Summary
Public Methods | ||
public |
setColorOutputEnabled(enabled: Boolean) Enables or disables color output. |
|
public |
setLuminanceRangeEnabled(enabled: Boolean) Enables or disables the luminance mask. |
Public Constructors
public constructor(colorOutput: Boolean, luminanceRange: Vector2) source
Constructs a new luminosity material.
Params:
Name | Type | Attribute | Description |
colorOutput | Boolean |
|
Defines whether the shader should output colours scaled with their luminance value. |
luminanceRange | Vector2 |
|
If provided, the shader will mask out texels that aren't in the specified luminance range. |