Repository navigation
decode.webgpu.Class.HDRJPGNodeLoader
@monogrid/gainmap-js / decode/webgpu / 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.
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-
LoaderBaseNode<string>
new HDRJPGNodeLoader(
manager?):HDRJPGNodeLoader
Defined in: node_modules/@types/three/src/loaders/Loader.d.ts:7
LoadingManager
HDRJPGNodeLoader
LoaderBaseNode<string>.constructor
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
string
Path to a JPEG file containing embedded gain map metadata
(data) => void
Load complete callback, will receive the node
(event) => void
Progress callback, will receive a ProgressEvent
(err) => void
Error callback
a node which can be used immediately, it will hold the image once loaded
LoaderBaseNode.load