how to improve the quality using lights. i have downloaded the 3d gltf from https://sketchfab.com/3d-models/rock-jacket-mid-poly-25711a832a344c2dbe0b592c9d98707b
i tried rendering the image in my local setup and it is not looking quality wise good. how to improve it. everytime i try rendering different 3d models in same code, its quality and look wise differs how to fix it???
this is how it should look ( https://gltf-viewer.donmccurdy.com/) ::
this how it is rendering in my local setup:
Code i tried:
const ambientLight = new THREE.AmbientLight(0xffffff, 0.53);
this.scene.add(ambientLight);
const lightProbe = new THREE.LightProbe();
this.scene.add(lightProbe);
const directionalLight1 = new THREE.DirectionalLight(0xffffff, 3);
directionalLight1.position.set(10, 10, 10);
this.scene.add(directionalLight1);
const directionalLight2 = new THREE.DirectionalLight(0xffffff, 3);
directionalLight2.position.set(0, -10, 0);
this.scene.add(directionalLight2);
const directionalLight3 = new THREE.DirectionalLight(0xffffff, 3);
directionalLight3.position.set(0, 0, 0);
this.scene.add(directionalLight3);
//gltf loading
var loader = new GLTFLoader();
var dracoLoader = new DRACOLoader();
DRACOLoader.setDecoderPath("draco/gltf/");
loader.setDRACOLoader( dracoLoader );
loader.load('rock/scene.gltf', gltf => {
gltf.scene.traverse( function ( child ) {
if ( child instanceof THREE.Mesh ) {
child.geometry.computeFaceNormals();
child.geometry.computeVertexNormals();
child.material.side = THREE.DoubleSide;
// child.material.shading = THREE.SmoothShading;
}
});
var box = new THREE.Box3();
box.setFromObject(gltf.scene);
var size = new THREE.Vector3();
box.getSize(size);
var center = new THREE.Vector3();
box.getCenter(center);
var scale =this.desiredHeight / size.y;
gltf.scene.scale.setScalar(scale);
gltf.scene.position.sub(center.multiplyScalar(scale));
this.scene.add(gltf.scene);
this.renderer.setSize( this.width, this.height );
this.renderer.render( this.scene, this.camera );
this.renderer.gammaOutput = true;
this.renderer.gammaInput = true;
this.mount.appendChild( this.renderer.domElement );
});