On Three.js, there are 2 sample scenes demonstrating how to import gltf models. Both utilize an RGBELoader function to set up the background.
new RGBELoader()
.setDataType( THREE.UnsignedByteType )
.setPath( 'textures/equirectangular/' )
.load( 'venice_sunset_2k.hdr', function ( texture ) {
var cubeGenerator = new EquirectangularToCubeGenerator( texture, { resolution: 1024 } );
cubeGenerator.update( renderer );
//background = cubeGenerator.renderTarget;
var pmremGenerator = new PMREMGenerator( cubeGenerator.renderTarget.texture );
pmremGenerator.update( renderer );
var pmremCubeUVPacker = new PMREMCubeUVPacker( pmremGenerator.cubeLods );
pmremCubeUVPacker.update( renderer );
envMap = pmremCubeUVPacker.CubeUVRenderTarget.texture;
pmremGenerator.dispose();
pmremCubeUVPacker.dispose();
My goal is to have an empty background or just a ground without the need to load the background textures. I have tried commenting out the "background" line, but then my object appears without texture.
I am seeking a way to display the helmet/boombox (sample object in the gltf loader scene) without the background interfering. I believe the solution lies in manipulating the "envmap".