Skip to content

decode.webgpu.Class.GainMapNodeLoader

github-actions[bot] edited this page Oct 20, 2026 · 4 revisions

@monogrid/gainmap-js / decode/webgpu / GainMapNodeLoader

Class: GainMapNodeLoader

Defined in: src/decode/webgpu/loaders/GainMapNodeLoader.ts:28

A Three.js Loader for the gain map format stored as separate files (sdr image, gain map image, metadata json), returning a GainMapNode (a TSL texture node holding the decoded HDR image).

No renderer is needed: load returns the node synchronously, it can be assigned to materials right away and it is decoded on the GPU once loaded.

Example

import { GainMapNodeLoader } from '@monogrid/gainmap-js/webgpu'
import { MeshBasicNodeMaterial } from 'three/webgpu'

const hdr = new GainMapNodeLoader().load([
  'sdr.webp',
  'gainmap.webp',
  'metadata.json'
])

const material = new MeshBasicNodeMaterial()
material.colorNode = hdr

Extends

  • LoaderBaseNode<[string, string, string]>

Constructors

Constructor

new GainMapNodeLoader(manager?): GainMapNodeLoader

Defined in: node_modules/@types/three/src/loaders/Loader.d.ts:7

Parameters

manager?

LoadingManager

Returns

GainMapNodeLoader

Inherited from

LoaderBaseNode<[string, string, string]>.constructor

Methods

load()

load(urls, onLoad?, onProgress?, onError?): GainMapNode

Defined in: src/decode/webgpu/loaders/GainMapNodeLoader.ts:43

Loads a gainmap using separate data

  • sdr image
  • gain map image
  • metadata json

useful for webp gain maps

Parameters

urls

[string, string, string]

An array in the form of [sdr.jpg, gainmap.jpg, metadata.json]

onLoad?

(data) => void

Load complete callback, will receive the node

onProgress?

(event) => void

Progress callback, will receive a ProgressEvent

onError?

(err) => void

Error callback

Returns

GainMapNode

a node which can be used immediately, it will hold the image once loaded

Overrides

LoaderBaseNode.load

Clone this wiki locally