Repository navigation
decode.webgpu.Class.GainMapNodeLoader
@monogrid/gainmap-js / decode/webgpu / 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.
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-
LoaderBaseNode<[string,string,string]>
new GainMapNodeLoader(
manager?):GainMapNodeLoader
Defined in: node_modules/@types/three/src/loaders/Loader.d.ts:7
LoadingManager
GainMapNodeLoader
LoaderBaseNode<[string, string, string]>.constructor
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
[string, string, string]
An array in the form of [sdr.jpg, gainmap.jpg, metadata.json]
(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