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

LookupTexture

Extends:

three~Data3DTexture → LookupTexture

A 3D lookup texture (LUT).

This texture can be used as-is in a WebGL 2 context. It can also be converted into a 2D texture.

Static Method Summary

Static Public Methods
public static

Creates a neutral 3D LUT.

public static

from(texture: Texture): LookupTexture

Creates a new 3D LUT by copying a given LUT.

Constructor Summary

Public Constructor
public

constructor(data: TypedArray, size: Number)

Constructs a cubic 3D lookup texture.

Member Summary

Public Members
public
public

domainMax: Vector3

The upper bounds of the input domain.

public

domainMin: Vector3

The lower bounds of the input domain.

public

format: *

public get
this get was deprecated.

Indicates that this is an instance of LookupTexture3D.

public
public
public
public

type: *

public
public

wrapR: *

public

wrapS: *

public

wrapT: *

Method Summary

Public Methods
public

Applies the given LUT to this one.

public

Converts the output of this LUT into sRGB color space.

public

Converts the output of this LUT into linear color space.

public

Converts the LUT data into float data.

public
this method was deprecated. LUTs are RGBA by default since three r137.

Converts this LUT into RGBA data.

public

Converts the LUT data into unsigned byte data.

public

scaleUp(size: Number, transferData: Boolean): Promise<LookupTexture>

Scales this LUT up to a given target size using tetrahedral interpolation.

public

toDataTexture(): DataTexture

Converts this LUT into a 2D data texture.

Static Public Methods

public static createNeutral(size: Number): LookupTexture source

Creates a neutral 3D LUT.

Params:

NameTypeAttributeDescription
size Number

The sidelength.

Return:

LookupTexture

A neutral 3D LUT.

public static from(texture: Texture): LookupTexture source

Creates a new 3D LUT by copying a given LUT.

Common image-based textures will be converted into 3D data textures.

Params:

NameTypeAttributeDescription
texture Texture

The LUT. Assumed to be cubic.

Return:

LookupTexture

A new 3D LUT.

Public Constructors

public constructor(data: TypedArray, size: Number) source

Constructs a cubic 3D lookup texture.

Params:

NameTypeAttributeDescription
data TypedArray

The pixel data. The default format is RGBA.

size Number

The sidelength.

Public Members

public colorSpace: * source

public domainMax: Vector3 source

The upper bounds of the input domain.

public domainMin: Vector3 source

The lower bounds of the input domain.

public format: * source

public get isLookupTexture3D: Boolean source

this get was deprecated.

Indicates that this is an instance of LookupTexture3D.

public magFilter: * source

public minFilter: * source

public needsUpdate: boolean source

public type: * source

public unpackAlignment: number source

public wrapR: * source

public wrapS: * source

public wrapT: * source

Public Methods

public applyLUT(lut: LookupTexture): LookupTexture source

Applies the given LUT to this one.

Params:

NameTypeAttributeDescription
lut LookupTexture

A LUT. Must have the same dimensions, type and format as this LUT.

Return:

LookupTexture

This texture.

public convertLinearToSRGB(): LookupTexture source

Converts the output of this LUT into sRGB color space.

Return:

LookupTexture

This texture.

public convertSRGBToLinear(): LookupTexture source

Converts the output of this LUT into linear color space.

Return:

LookupTexture

This texture.

public convertToFloat(): LookupTexture source

Converts the LUT data into float data.

Return:

LookupTexture

This texture.

public convertToRGBA(): LookupTexture source

this method was deprecated. LUTs are RGBA by default since three r137.

Converts this LUT into RGBA data.

Return:

LookupTexture

This texture.

public convertToUint8(): LookupTexture source

Converts the LUT data into unsigned byte data.

This is a lossy operation which should only be performed after all other transformations have been applied.

Return:

LookupTexture

This texture.

public scaleUp(size: Number, transferData: Boolean): Promise<LookupTexture> source

Scales this LUT up to a given target size using tetrahedral interpolation.

Params:

NameTypeAttributeDescription
size Number

The target sidelength.

transferData Boolean
  • optional
  • default: true

Extra fast mode. Set to false to keep the original data intact.

Return:

Promise<LookupTexture>

A promise that resolves with a new LUT upon completion.

public toDataTexture(): DataTexture source

Converts this LUT into a 2D data texture.

Please note that custom input domains are not carried over to 2D textures.

Return:

DataTexture

The texture.