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

LuminanceMaterial

Extends:

three~ShaderMaterial → LuminanceMaterial

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
this method was deprecated. Use colorOutput instead.

Indicates whether color output is enabled.

public
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
this method was deprecated. Use smoothing instead.

Sets the luminance threshold smoothing factor.

public
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:

NameTypeAttributeDescription
colorOutput Boolean
  • optional
  • default: false

Defines whether the shader should output colors scaled with their luminance value.

luminanceRange Vector2
  • optional

If provided, the shader will mask out texels that aren't in the specified luminance range.

Public Members

public get colorOutput: Boolean source

Indicates whether color output is enabled.

public set colorOutput source

public set inputBuffer: Texture source

The input buffer.

public get luminanceRange: Boolean source

The luminance range. Set to null to disable.

public set luminanceRange source

public needsUpdate: boolean source

public get smoothing: Number source

The luminance threshold smoothing.

public set smoothing source

public get threshold: Number source

The luminance threshold.

public set threshold source

public get useRange: Boolean source

this get was deprecated.

Indicates whether luminance masking is enabled.

public set useRange source

public get useThreshold: Boolean source

this get was deprecated. Adjust the threshold or smoothing factor instead.

Indicates whether the luminance threshold is enabled.

public set useThreshold source

Public Methods

public getLuminanceRange(): Vector2 source

this method was deprecated. Use luminanceRange instead.

Returns the current luminance range.

Return:

Vector2

The luminance range.

public getSmoothingFactor(): Number source

this method was deprecated. Use smoothing instead.

Returns the luminance threshold smoothing factor.

Return:

Number

The smoothing factor.

public getThreshold(): Number source

this method was deprecated. Use threshold instead.

Returns the luminance threshold.

Return:

Number

The threshold.

public isColorOutputEnabled(value: *): Boolean source

this method was deprecated. Use colorOutput instead.

Indicates whether color output is enabled.

Params:

NameTypeAttributeDescription
value *

Return:

Boolean

Whether color output is enabled.

public setColorOutputEnabled(value: Boolean) source

this method was deprecated. Use colorOutput instead.

Enables or disables color output.

Params:

NameTypeAttributeDescription
value Boolean

Whether color output should be enabled.

public setInputBuffer(value: Texture) source

this method was deprecated. Use inputBuffer instead.

Sets the input buffer.

Params:

NameTypeAttributeDescription
value Texture

The input buffer.

public setLuminanceRange(value: Vector2) source

this method was deprecated. Use luminanceRange instead.

Sets a luminance range. Set to null to disable.

Params:

NameTypeAttributeDescription
value Vector2

The luminance range.

public setSmoothingFactor(value: Number) source

this method was deprecated. Use smoothing instead.

Sets the luminance threshold smoothing factor.

Params:

NameTypeAttributeDescription
value Number

The smoothing factor.

public setThreshold(value: Number) source

this method was deprecated. Use threshold instead.

Sets the luminance threshold.

Params:

NameTypeAttributeDescription
value Number

The threshold.