Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RGBELoader low quality of texture - 256 x 256

Tags:

three.js

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]

like image 352
Miro Avatar asked Nov 16 '25 04:11

Miro


1 Answers

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

like image 75
Mugen87 Avatar answered Nov 18 '25 21:11

Mugen87



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!