How to improve quality of gltf/fbx 3d models similar to three js GLTF viewer or sketchfab

how to improve the quality using lights. i have downloaded the 3d gltf from
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 ( ::

this how it is rendering in my local setup:

Code i tried:

      const ambientLight = new THREE.AmbientLight(0xffffff, 0.53);
         const lightProbe = new THREE.LightProbe();
         const directionalLight1 = new THREE.DirectionalLight(0xffffff, 3);
         directionalLight1.position.set(10, 10, 10);
         const directionalLight2 = new THREE.DirectionalLight(0xffffff, 3);
         directionalLight2.position.set(0, -10, 0);
         const directionalLight3 = new THREE.DirectionalLight(0xffffff, 3);
         directionalLight3.position.set(0, 0, 0);
   //gltf loading
    var loader = new GLTFLoader();
    var dracoLoader = new DRACOLoader();
    loader.setDRACOLoader( dracoLoader );
    loader.load('rock/scene.gltf', gltf => {
        gltf.scene.traverse( function ( child ) {
            if ( child instanceof THREE.Mesh ) {
                  child.material.side = THREE.DoubleSide;
                  // child.material.shading = THREE.SmoothShading;
    var box = new THREE.Box3();
    var size = new THREE.Vector3();
    var center = new THREE.Vector3();
    var scale =this.desiredHeight / size.y;
    this.renderer.setSize( this.width, this.height );
    this.renderer.render( this.scene, );
    this.renderer.gammaOutput = true;
    this.renderer.gammaInput = true;
    this.mount.appendChild( this.renderer.domElement );

An environment map (or image-based lighting) would be a good place to start. See this example for how to set that up:


The gltf-viewer source code is very readable. You can see how lights and environment maps are set up here:


thanks… i tried this, gltf is rendering , fbx and obj is not rendering after changing the loader. this code will work for fbx and obj too right??

Any solution to this ? we are also looking for ways to looks models look great using three.js

@Tushar_Sharma Great visual results require a good model and good lighting. You’ll need to share something about what you’re doing now (code and demo are best) if you want feedback to improve your current results. If you need somewhere to start, the source code at may be helpful.

this really looks like you’re not using any environment map. Why don’t you make a metal shiny sphere next to the jacket and see if you get any reflections?

Also, wow, besides being a very very well made model, it has a doom patch :smiley: crust punx ftw

1 Like

@Tushar_Sharma as suggested by donmccurdy , i took the code from bit helpful.