Home Reference Source
import {LuminanceMaterial} from 'postprocessing/src/materials/LuminanceMaterial.js'
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 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 luminance material.

Member Summary

Public Members
public

Method Summary

Public Methods
public

Enables or disables color output.

public

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 colours 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 needsUpdate: boolean source

Public Methods

public setColorOutputEnabled(enabled: Boolean) source

Enables or disables color output.

Params:

NameTypeAttributeDescription
enabled Boolean

Whether color output should be enabled.

public setLuminanceRangeEnabled(enabled: Boolean) source

Enables or disables the luminance mask.

Params:

NameTypeAttributeDescription
enabled Boolean

Whether the luminance mask should be enabled.