3

For some reason RGBELoader() generates 256x256 textures regardless of what the source is (4k). I tried using the pmremGenerator and it doesn't seem to work with or without it.

new RGBELoader()
                .setPath( './maps/' )
                .load( 'empty_warehouse_01_4k.hdr', function ( texture ) {

                        //texture.mapping = THREE.EquirectangularReflectionMapping;
                        const envMap = pmremGenerator.fromEquirectangular( texture ).texture;

                        scene.background = envMap; //or 'texture' to bypass pmremGenerator
                        scene.environment = envMap;

}

let pmremGenerator = new THREE.PMREMGenerator( renderer )
pmremGenerator.compileEquirectangularShader();

Here's the result:

enter image description here

This is the 4k HDR quality:

enter image description here

The only example that has high quality background and environment map is this one but it uses THree.CubeTextureLoader() and it only takes LDR (.jpg).

https://threejs.org/examples/?q=env#webgl_materials_envmaps [Source]

Miro
  • 8,402
  • 3
  • 34
  • 72

1 Answers1

2

RGBELoader does not alter the resolution of your texture. The problem in your code is that the result of PMREMGenerator should not be used for Scene.background.

Besides, the renderer automatically preprocesses assigned HDR environment map with PMREMGenerator for PBR materials since r131. So when loading HDR environment maps via classes like RGBELoader or EXRLoader, there should be no reason for using PMREMGenerator on app level with latest releases.

Please use the official glTF example as a code template: https://threejs.org/examples/webgl_loader_gltf

Mugen87
  • 28,829
  • 4
  • 27
  • 50
  • 1
    Thanks a lot. I knew `PMREMGenerator` was not needed but decided to try anyway. The example that you gave is what I've been using and it suffers from the low quality same issue. It uses `scene.background = texture;`. I guess I can use high-res jpg for the background but it still doesn't solve the issue with the low-res reflection map. – Miro Oct 12 '21 at 09:27