Use RGBEloader
to load the .hdr
file, and in callback function use PMREMGenerator
to generate the map from this HDR file. Then set the envMap
parameter for your physical material:
let generator = new THREE.PMREMGenerator(renderer);
new RGBELoader().load('textures/gothic_manor_02_2k.hdr', (hdrmap) => {
// ...
let envmap = generator.fromEquirectangular(hdrmap);
const ballMaterial = {
// ...
envMap: envmap.texture
};
});