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

Enables or disables color output.

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

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: Boolean source

Enables or disables color output.

public get luminanceRange: Boolean source

this get was deprecated. Use useRange instead.

Indicates whether luminance masking is enabled.

public set luminanceRange: Boolean source

this set was deprecated. Use useRange instead.

Enables or disables luminance masking.

public needsUpdate: boolean source

public get smoothing: Number source

The luminance threshold smoothing.

public set smoothing: Number source

Sets the luminance threshold smoothing.

public get threshold: Number source

The luminance threshold.

public set threshold: Number source

Sets the luminance threshold.

public get useRange: Boolean source

Indicates whether luminance masking is enabled.

public set useRange: Boolean source

Enables or disables luminance masking.

If enabled, the threshold will be ignored.

public get useThreshold: Boolean source

Indicates whether the luminance threshold is enabled.

public set useThreshold: Boolean source

Enables or disables the luminance threshold.

Public Methods

public setColorOutputEnabled(enabled: Boolean) source

this method was deprecated. Use colorOutput instead.

Enables or disables color output.

Params:

NameTypeAttributeDescription
enabled Boolean

Whether color output should be enabled.

public setLuminanceRangeEnabled(enabled: Boolean) source

this method was deprecated. Use luminanceRange instead.

Enables or disables the luminance mask.

Params:

NameTypeAttributeDescription
enabled Boolean

Whether the luminance mask should be enabled.