HDR decode path
Return texture data; leave display policy to the renderer.
The loader expands RGBE values into a usable texture representation. Applications can then select environment mapping, filtering, exposure, and tone mapping according to the scene.
Detect
Read Radiance HDR headers and scanline-encoded data.
Expand
Decode shared-exponent RGBE pixels.
Return
Expose dimensions, levels, formats, and floating-point data.
Render
Apply application-specific lighting and display policy.
Detailed guide
RadianceHDRLoader reference
The detailed reference covers input detection, decoded texture levels, RGBE values, options, and common rendering uses.
Loader for Radiance RGBE .hdr textures.
See also: Radiance HDR
| RadianceHDRLoader | |
|---|---|
| File Format | Radiance HDR / RGBE |
| File Extension | .hdr |
| File Type | Binary |
| Data Format | Texture |
| Supported APIs | load, parse, parseSync |
Usage
import {RadianceHDRLoader} from '@loaders.gl/images/radiance-hdr';
import {load} from '@loaders.gl/core';
const texture = await load(url, RadianceHDRLoader);
const level = texture.data[0];
console.log(texture.type, level.width, level.height);
console.log(texture.format, level.format);
console.log(level.data instanceof Float32Array);
console.log(texture.metadata?.exposure);
Data Format
Returns a Texture with shape: 'texture', type: '2d', and one decoded level in data.
The returned texture includes:
shape: 'texture'type: '2d'format: 'rgba32float'data: TextureLevel[]metadata?: RadianceHDRMetadata
Metadata
When present in the file, RadianceHDRLoader exposes application-facing header metadata on texture.metadata.
type RadianceHDRMetadata = {
colorCorrection?: [number, number, number];
exposure?: number;
gamma?: number;
pixelAspectRatio?: number;
primaries?: [number, number, number, number, number, number, number, number];
software?: string;
view?: string;
};
The loader does not expose internal parsing fields such as normalized scanline orientation or format markers in metadata.
The returned level includes:
shape: 'texture-level'compressed: falseformat: GL_RGBA32FtextureFormat: 'rgba32float'widthheightdata: Float32ArraylevelSize
Options
| Option | Type | Default | Description |
|---|---|---|---|
| N/A |
Notes
- File format background:
Radiance HDR RadianceHDRLoaderdecodes standard 2D Radiance RGBE files only.- The alpha channel is synthesized as
1.0for every pixel.