I am trying to import a 3D object from Cinema4D into Three.js using GLTFLoader. However, this object is completely black with an AmbientLight. Now I have found out that it is due to the material used. If I now nest the GLTFLoader in a RGBELoader, my 3D object gets more correct lighting (see the screenshots).
Attachments:
new RGBELoader()
.load( 'royal_esplanade_1k.hdr', function ( texture ) {
texture.mapping = THREE.EquirectangularReflectionMapping;
scene.background = texture;
scene.environment = texture;
render();
// model
const loader = new GLTFLoader();
loader.load( 'Cube2.glb', function ( gltf ) {
scene.add( gltf.scene );
render();
} );
} );
const light = new THREE.AmbientLight( 0xffffff, 1 ); // soft white light
scene.add( light );
scene.background = new THREE.Color( 0x808080 );
const loader = new GLTFLoader();
loader.load( 'Cube2.glb', function ( gltf ) {
scene.add( gltf.scene );
render();
} );