Viewing in Babylon or glTF Viewer compared to Three.js

My Blender model looks a lot better when I view the glTF export in Babylon or glTF Viewer than when I load it into a webpage with Three.js and GLTLoader.js. Mainly the colours and reflections. How are the viewers displaying these when my webpage model isn’t? What are they doing differently? Can I use any of that code in my three.js model.
Cheers!!

Are you referring on https://gltf-viewer.donmccurdy.com/? If so, the project uses three.js/ THREE.GLTFLoader and is open-source. By studying the code, you should be able to setup your scene in the same way :blush:

1 Like

Ah yes I am, but I couldn’t figure out how to view the code

1 Like

Thanks again @Mugen87.
Do you know if there’s a way to view code only relevant to my model rather than everything?

Not sure I understand. Can you please explain in more detail what you mean?

If I drag my gltf into glTF Viewer can I download the relevant code my model is using from there rather than going through everything on the github page? Or am I missing something?
Cheers

If I drag my gltf into glTF Viewer can I download the relevant code my model is using from there…

No, the code is the same for every model. Start with viewer.js and observe how the renderer and lights are set up. Using an environment map makes a big difference, especially for metallic materials. If you can provide more information (code, demo, screenshots?) we might be able to suggest areas for improvement too.

2 Likes