donmccurdy / three-gltf-viewer

Drag-and-drop preview for glTF 2.0 models in WebGL using three.js.
https://gltf-viewer.donmccurdy.com/
MIT License
2.09k stars 534 forks source link

Lighting question #289

Closed SachaVeldhoen closed 2 years ago

SachaVeldhoen commented 2 years ago

When I put my gltf file on your the GLTF-viewer website is show the gltf object perfectly with the lighting being perfect. Im trying to put this gltf file on my own website but then the colors of it just look kinda weird. Im trying to get the good amount of light from THREE but I can't find it. When I import it on your website its perfect. Wich lights and what settings do you use for it? I can't find it in you files on wich ones are enabled. On your website I uncheck the "add lights" part because I don't need those. Just the standard lighting without the "add lights" option. Thanks!

donmccurdy commented 2 years ago

Hi @SachaVeldhoen! The highest-quality lighting for PBR materials is an environment map, set with material.envMap or scene.environment. That's all you're seeing here, when 'add lights' is disabled. The environment maps I'm using are in this folder, or you can find more on sites like https://polyhaven.com/hdris. This three.js example is a good demo of how to use the environment map in your code.

SachaVeldhoen commented 2 years ago

Hello @donmccurdy. Thanks for the fast responce! I will going to take a look at it. Thanks!