A 3D LUT loader that supports the .cube file format.

Based on an implementation by Garrett Johnson: https://github.com/gkjohnson/threejs-sandbox/tree/master/3d-lut

For more details see: https://wwwimages2.adobe.com/content/dam/acom/en/products/speedgrade/cc/pdfs/cube-lut-specification-1.0.pdf

Hierarchy

  • Loader
    • LUTCubeLoader

Constructors

  • Parameters

    • Optional manager: LoadingManager

    Returns LUTCubeLoader

Properties

crossOrigin: string

Default

'anonymous'
manager: LoadingManager
path: string

Default

''
requestHeader: {
    [header: string]: string;
}

Type declaration

  • [header: string]: string

Default

{}
resourcePath: string

Default

''
withCredentials: boolean

Default

false
DEFAULT_MATERIAL_NAME: string

Methods

  • Loads a LUT.

    Parameters

    • url: string

      The URL of the CUBE-file.

    • Optional onLoad: Function

      A callback that receives the loaded lookup texture.

    • Optional onProgress: Function

      A progress callback that receives the XMLHttpRequest instance.

    • Optional onError: Function

      An error callback that receives the URL of the file that failed to load.

    Returns Promise<LookupTexture>

    A promise that returns the lookup texture.

  • Parameters

    • url: string
    • Optional onProgress: ((event) => void)
        • (event): void
        • Parameters

          • event: ProgressEvent<EventTarget>

          Returns void

    Returns Promise<unknown>

  • Parses the given data.

    Parameters

    • input: string

      The LUT data.

    Returns LookupTexture

    The lookup texture.

    Throws

    Fails if the data is invalid.

  • Parameters

    • crossOrigin: string

    Returns LUTCubeLoader

  • Parameters

    • requestHeader: {
          [header: string]: string;
      }
      • [header: string]: string

    Returns LUTCubeLoader

  • Parameters

    • resourcePath: string

    Returns LUTCubeLoader

  • Parameters

    • value: boolean

    Returns LUTCubeLoader