Skip to content

decode.webgpu.Class.HDRJPGNodeLoader

github-actions[bot] edited this page Oct 19, 2026 · 3 revisions

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

Class: HDRJPGNodeLoader

Defined in: src/decode/webgpu/loaders/HDRJPGNodeLoader.ts:32

A Three.js Loader for a JPEG with embedded gain map metadata, returning a GainMapNode (a TSL texture node holding the decoded HDR image).

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

Example

import { HDRJPGNodeLoader } from '@monogrid/gainmap-js/webgpu'
import { equirectUV } from 'three/tsl'
import { MeshBasicNodeMaterial } from 'three/webgpu'

const hdr = new HDRJPGNodeLoader().load('gainmap.jpeg')

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

scene.backgroundNode = hdr.sample(equirectUV())

// all parameters are uniforms, changing them re-decodes the image once
hdr.maxDisplayBoost.value = 2

Extends

  • LoaderBaseNode<string>

Constructors

Constructor

new HDRJPGNodeLoader(manager?): HDRJPGNodeLoader

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

Parameters

manager?

LoadingManager

Returns

HDRJPGNodeLoader

Inherited from

LoaderBaseNode<string>.constructor

Methods

load()

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

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

Loads a JPEG containing gain map metadata Renders a normal SDR image if gainmap data is not found

Parameters

url

string

Path to a JPEG file containing embedded gain map metadata

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