Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glTF 2.0 model so dark in viewport #124

Open
SmaugArt opened this issue Jul 7, 2021 · 3 comments
Open

glTF 2.0 model so dark in viewport #124

SmaugArt opened this issue Jul 7, 2021 · 3 comments

Comments

@SmaugArt
Copy link

SmaugArt commented Jul 7, 2021

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?"

@sophie1000
Copy link

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.

@GiovanniTurri
Copy link

GiovanniTurri commented Sep 27, 2021

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

@AdaRoseCannon
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants