I tried loading a 3d glb model in threejs project but after loading the loading the model. I added an environment like HDRI lighting. The model is not appearing smooth as expected. Can you help in that?
My init function is as follow:
scene.castShadow = true
scene.receiveShadow = true
scene.add(new THREE.AxesHelper(5))
camera.position.set(15, 15, 15)
camera.lookAt(0, 5, 0);
dracoLoadergLB.setDecoderConfig({ type: 'js' });
dracoLoadergLB.setDecoderPath('https://www.gstatic.com/draco/v1/decoders/');
const renderer = new THREE.WebGLRenderer({ antialias: true, preserveDrawingBuffer: true })
renderer.setSize(window.innerWidth, window.innerHeight)
renderer.shadowMap.enabled = true
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
renderer.outputEncoding = THREE.sRGBEncoding;
renderer.physicallyCorrectLights = true;
renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1;
renderer.gammaOutput = true;
renderer.gammaFactor = 2.2;
renderer.domElement.addEventListener('click', onClick, false);
if (window.innerWidth >= 600) {
renderer.setPixelRatio(window.devicePixelRatio);
}
setRenderer(renderer)
const { current: container } = refContainer;
container.append(renderer.domElement)
composer = new EffectComposer( renderer );
composer.setPixelRatio(window.devicePixelRatio);
composer.setSize(window.innerWidth, window.innerHeight);
const renderPass = new RenderPass( scene, camera );
composer.addPass( renderPass );
// const glitchPass = new GlitchPass();
// composer.addPass( glitchPass );
viewHelper = new ViewHelper( camera, renderer.domElement );
orbitControls = setControlsOrbitScene(renderer, camera, orbitControls)
controls = setControlsFirstPerson(camera, renderer, controls)
orbitControls.keyPanSpeed = 20
When uploaded the same model on editor it appears smooth and good quality