Basic glTF loader class.
Allow to load an HDR file from an URI and returns a HDRImageData object containing the Float32Array data alongside width, height and other useful information.
const hdrLoader = new HDRLoader()const hdr = await hdrLoader.loadFromUrl('path/to/environment.hdr')// assuming `renderer` is a valid Rendererconst envTexture = new Texture(renderer, { label: 'Environment texture', name: 'envTexture', visibility: ['fragment'], format: 'rgba16float', generateMips: true, fixedSize: { width: hdr.width, height: hdr.height, },})envTexture.uploadData({ data: hdr.data,}) Copy
const hdrLoader = new HDRLoader()const hdr = await hdrLoader.loadFromUrl('path/to/environment.hdr')// assuming `renderer` is a valid Rendererconst envTexture = new Texture(renderer, { label: 'Environment texture', name: 'envTexture', visibility: ['fragment'], format: 'rgba16float', generateMips: true, fixedSize: { width: hdr.width, height: hdr.height, },})envTexture.uploadData({ data: hdr.data,})
Load and decode RGBE-encoded data to a flat list of floating point pixel data (RGBA).
The url of the .hdr file to load.
Basic glTF loader class.
Allow to load an HDR file from an URI and returns a HDRImageData object containing the Float32Array data alongside width, height and other useful information.
Example