webxr-samples icon indicating copy to clipboard operation
webxr-samples copied to clipboard

glTF 2.0 model so dark in viewport

Open SmaugArt opened this issue 3 years ago • 3 comments

Hello. I have a little problem. When I export my model from blender to gltf 2.0 and render it to the webxr scene, the model appears so dark, but the samples have normal light. When I tried to re-export any model from "media / gltf" the same problem occurs. What could cause this effect?"

SmaugArt avatar Jul 07 '21 02:07 SmaugArt

Hi,

I had the same problem. Maybe you've found a solution since you posted this but for the people from the future :

If you go to JS > render > core > renderer.js you will find this line :

const DEF_LIGHT_COLOR = new Float32Array([2, 2, 2]);

I've found that if you increase the value between the [., ., .,] it will add more light in your scene. You can also change the light direction in the line above.

sophie1000 avatar Sep 02 '21 18:09 sophie1000

Thank you @sophie1000 , I noticed that also in JS > render > materials > pbr.js there are some variables (find 'light' in the file) somewhat changes but I think we need to act also inside *.glb files (using Blender or other tools). Infact, changing materials to textures (starting from sunflower.gltf from examples) in models that have their own light solved almost entirely the problem for me.

From samples, I noticed that light works well on the *.glTF files with

"asset" : {
        "generator" : "Khronos glTF **Blender I/O** v1.0.5",
        "version" : "2.0"

There is https://immersive-web.github.io/webxr-input-profiles/packages/assets/tutorial/ but the profiles directory with profile.json is no more available (maybe was moved).

Don't know if @klausw has some lines of code (maybe in three.js) or some suggestions about lights settings in the model.

Thank you everyone

GiovanniTurri avatar Sep 27 '21 10:09 GiovanniTurri

I had a similar issue in my project which I fixed by using: renderer.outputEncoding = sRGBEncoding;

AdaRoseCannon avatar Jan 14 '22 13:01 AdaRoseCannon