google / filament

Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2
https://google.github.io/filament/
Apache License 2.0
17.59k stars 1.86k forks source link

Point light is not effective #7536

Closed wddl closed 7 months ago

wddl commented 7 months ago

Describe the bug Some point light has been set in the GLTF file, but there is no lighting effect in the rendering。But, in some other glTF files, the same point light settings have an effect. All point light settings is same。

To Reproduce Steps to reproduce the behavior:

  1. Load gltf file
  2. View the point light effect

Expected behavior The point light is rendered correctly

Screenshots this is gltf file that is not correctly: image this is gltf file that is correctly: image

Logs

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context This is a glTF file that is not displayed correctly: lululemon2.zip Thsi is a gltf file this is displayed correctly: hshl1.zip

pixelflinger commented 7 months ago

I am not able to reproduce this problem: llulemon

romainguy commented 7 months ago

Works for me too

wddl commented 7 months ago

@pixelflinger @romainguy Thanks for reply! @pixelflinger In your example, the camera aperture is set to 2.845 and the camera ISO is set to 800. However, in my example, the camera aperture and camera ISO are set to their default values of 16 and 100 respectively. The issue is that even with the same default camera settings and the same point light parameter settings in my example, why different glTF files exhibit different effects?Please refer to the another attached glTF file for comparison. Thanks! image

pixelflinger commented 7 months ago

I also didn't see that problem. With the default settings, the other gltf didn't show the lights either, because the camera settings were too dark.

In my tests I saw the same behavior with both gltf.

wddl commented 7 months ago

I also didn't see that problem. With the default settings, the other gltf didn't show the lights either, because the camera settings were too dark.

In my tests I saw the same behavior with both gltf.

@pixelflinger In the another gltf .The lighting effect of the file after setting the following parameters is as follows. It can be seen that this gltf clearly has a lighting effect. Is your example the same? image

pixelflinger commented 7 months ago

Yeah okay, this happens because gltf_viewer resizes the model to fit a 1x1 cube by default (unless you use the -s option). Because the two models don't have the same initial size, the models are resized by a different factor.

Unfortunately, this resizing doesn't affect the the light radius nor the light intensity.

So as you can imagine the same light source placed in a room size environment, vs, a model/toy size environment will not produce the same result.

To see the actual effect of a light as intended by the gltf model, you need to use the -s option.