-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
"gltfviewer -s" results in no lighting #3366
Comments
thanks in advance |
There’s a directional light by default, no point lights. Could you provide screenshots please? Directional lighting works with or without -s in all my tests. |
In my gltf, there are two point light. we checked the code, without -s, gltf_viewer would execute function "fitIntoUnitCube", why is that? |
It does this so the loaded glTF can be visible from the default camera position and entirely visible on screen. This is a pretty common thing to do in 3D viewers. |
If the glTF file doesn't have a range set for punctual lights, we give it an arbitrary one (10.0 units I believe). When using |
The entire glTF file. |
@bejado That must be it then, I don't see a range in the glTF file. |
Based on the above discussion, we added "range":4000 for light property. with -s, lighting is still invisible. |
I can't open the glTF file in Blender because of the Draco mesh compression extension. @JackKaiXing Sorry to bother you, do you have a version of the asset that doesn't use Draco? I'd like to check where the lights are. |
gltf with no draco compression: https://github.com/JackKaiXing/glTF/tree/master/glTF/gltf_WithoutDraco |
The positions are correct, so either there's a bug on our side or it's simply that the intensity of the lights isn't enough for the distances because of the falloff. @JackKaiXing Could you try with brighter lights? |
we tried brighter lights by changing its intensity and still no lighting . |
It seems that this glTF model includes the For reference, here are the results displayed by other libraries.
Also, I think the lights on this model are too bright. |
sorry for the intensity of 50000 value, it is for our test. However, if we change the intensity to 3000, without -s there is lighting and with -s there is no lighting. About KHR_lights_punctual, without -s, lighting effects is visible. so I do think it is related. |
@JackKaiXing I'm sorry. Your point seems to be correct,
|
Filament supports |
Hmm, I tried to display the following model with https://github.com/Reon90/glTF-Sample-Models/tree/master/2.0/Lights
|
Does exposure also works for my case? I really hope to find out as we do not scale the scene. |
Yes the exposure works since the light is visible without |
@romainguy Does exposure also work for the JavaScript API? I tried let aperture = 1;
let shutterSpeed = 1;
let ISO = 350;
this.camera.setExposure(aperture, shutterSpeed, ISO); Perhaps I need to retrieve the |
Exposure should work in JavaScript yes. @prideout might help here |
We do have a JavaScript binding for the 3-argument |
Those results look correct to me. 1/1/100 is extremely bright, it's a 1 second exposure at ƒ/1, it's the kind of exposure you'd use for night time shots. |
@romainguy I'm sorry, I don't know much about cameras, so please tell me what parameters I should set. |
For what? The exposure you want to set depends on the intensity of your lights and the visuals you want to achieve. Note that we have a tone mapper that helps with this called "display range". It shows the exposure in EVs using color codes. |
@romainguy Thank you for the information. I have to go out now and will try it when I get back. |
I completely misunderstood the use of shutter speed in I improved the Filament sample in gltf-test so that you can adjust the Exposure settings like in
I understand how to change the Exposure, but I couldn't figure out how to display the
|
I think this bug is resolved, if not feel free to add a comment. |
Describe the bug
in windows, command "gltf_viewer my.gltf", that point lighting effect is visible; however, command "gltf_viewer -s my.gltf",that point lighting effect is gone. However, we do not want to scale the scene.
Expected behavior
how could be modify the code to control this?
The text was updated successfully, but these errors were encountered: