Hello guys!
I am starting in Three.js and I have encountered my first real issue.
I am trying to add a 3D model to my scene (I am using the GLFT Loader), but I have a big loss in the quality of the model.
Here is the model that I am using in a glTF viewer
And here is my version of the model in my scene
(here is the model if it can help: Retro computer - Download Free 3D model by Damla Yagli (@ddamlayagli) [8f2fb15] - Sketchfab)
I know that my lighting is not good for the moment, but I think that this is not my current problem, my model looks pixelated and I don’t think it is light-related.
Here is my renderer implementation
this.scene = new THREE.Scene();
this.camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
this.renderer = new THREE.WebGLRenderer();
this.renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(this.renderer.domElement);
const ambientLight = new THREE.AmbientLight(0xffffff, 1);
this.scene.add(ambientLight);
const directionalLight = new THREE.DirectionalLight(0xffffff, 0.5);
directionalLight.position.set(1, 1, 1);
this.scene.add(directionalLight);
And here is my model importation
const glftLoader = new THREE.GLTFLoader();
glftLoader.load('./models/new_retro_computer/scene.gltf', (gltfScene) => {
gltfScene.scene.position.z = settings.platformLength / 2 + 8;
gltfScene.scene.scale.set(2, 2, 2);
settings.scene.add(gltfScene.scene);
});
I tried a ToneMapping but the result was still the same so I am a bit lost here
Also a subsidiary question: in some online model viewers the light seems to always highlight the model so I was thinking of “sticking” my directionalLight to the camera to always put light where the user is looking but I don’t know if it’s a “normal” way to do it.
Thanks for your future answers