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

LookupTexture3D

Extends:

three~DataTexture3D → LookupTexture3D

A 3D lookup texture (LUT).

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

Static Method Summary

Static Public Methods
public static

Creates a neutral 3D LUT.

public static

from(texture: Texture): LookupTexture3D

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

domainMax: Vector3

The upper bounds of the input domain.

public

domainMin: Vector3

The lower bounds of the input domain.

public
public

format: *

public get

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

Converts the LUT data into RGBA data.

public

Converts the LUT data into unsigned byte data.

public

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

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): LookupTexture3D source

Creates a neutral 3D LUT.

Params:

NameTypeAttributeDescription
size Number

The sidelength.

Return:

LookupTexture3D

A neutral 3D LUT.

public static from(texture: Texture): LookupTexture3D 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:

LookupTexture3D

A new 3D LUT.

Public Constructors

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

Constructs a cubic 3D lookup texture.

Params:

NameTypeAttributeDescription
data TypedArray

The data.

size Number

The sidelength.

Public Members

public domainMax: Vector3 source

The upper bounds of the input domain.

public domainMin: Vector3 source

The lower bounds of the input domain.

public encoding: * source

public format: * source

public get isLookupTexture3D: Boolean source

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: LookupTexture3D): LookupTexture3D source

Applies the given LUT to this one.

Params:

NameTypeAttributeDescription
lut LookupTexture3D

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

Return:

LookupTexture3D

This texture.

public convertLinearToSRGB(): LookupTexture3D source

Converts the output of this LUT into sRGB color space.

Return:

LookupTexture3D

This texture.

public convertSRGBToLinear(): LookupTexture3D source

Converts the output of this LUT into linear color space.

Return:

LookupTexture3D

This texture.

public convertToFloat(): LookupTexture3D source

Converts the LUT data into float data.

Return:

LookupTexture3D

This texture.

public convertToRGBA(): LookupTexture3D source

Converts the LUT data into RGBA data.

Return:

LookupTexture3D

This texture.

public convertToUint8(): LookupTexture3D 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:

LookupTexture3D

This texture.

public scaleUp(size: Number, transferData: Boolean): Promise<LookupTexture3D> 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<LookupTexture3D>

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.