-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Strange light behavior with different far plane values of orthographic camera #4473
Comments
I think this will be fixed by #4345 - specifically the small pbr.wgsl change from that pr. could you please check? |
Yes, the issue is fixed there, great work! Do not forget to mark this issue as being resolved by #4345. |
To flesh out the test results a bit with what @kirusfg found and reported on Discord:
|
One more note, the following has been tested as an effective workaround: ClusterConfig::FixedZ {
total: 4096,
z_slices: 24,
z_config: ClusterZConfig {
first_slice_depth: 5.0,
far_z_mode: ClusterFarZMode::CameraFarPlane,
},
dynamic_resizing: false,
} Basically ensuring that the far z plane used for clustering matches the far z plane of the camera. |
# Objective - Fixes #4234 - Fixes #4473 - Built on top of #3989 - Improve performance of `assign_lights_to_clusters` ## Solution - Remove the OBB-based cluster light assignment algorithm and calculation of view space AABBs - Implement the 'iterative sphere refinement' algorithm used in Just Cause 3 by Emil Persson as documented in the Siggraph 2015 Practical Clustered Shading talk by Persson, on pages 42-44 http://newq.net/dl/pub/s2015_practical.pdf - Adapt to also support orthographic projections - Add `many_lights -- orthographic` for testing many lights using an orthographic projection ## Results - `assign_lights_to_clusters` in `many_lights` before this PR on an M1 Max over 1500 frames had a median execution time of 1.71ms. With this PR it is 1.51ms, a reduction of 0.2ms or 11.7% for this system. --- ## Changelog - Changed: Improved cluster light assignment performance Co-authored-by: robtfm <50659922+robtfm@users.noreply.github.com> Co-authored-by: Carter Anderson <mcanders1@gmail.com>
Fixed by #4345. |
# Objective - Fixes bevyengine#4234 - Fixes bevyengine#4473 - Built on top of bevyengine#3989 - Improve performance of `assign_lights_to_clusters` ## Solution - Remove the OBB-based cluster light assignment algorithm and calculation of view space AABBs - Implement the 'iterative sphere refinement' algorithm used in Just Cause 3 by Emil Persson as documented in the Siggraph 2015 Practical Clustered Shading talk by Persson, on pages 42-44 http://newq.net/dl/pub/s2015_practical.pdf - Adapt to also support orthographic projections - Add `many_lights -- orthographic` for testing many lights using an orthographic projection ## Results - `assign_lights_to_clusters` in `many_lights` before this PR on an M1 Max over 1500 frames had a median execution time of 1.71ms. With this PR it is 1.51ms, a reduction of 0.2ms or 11.7% for this system. --- ## Changelog - Changed: Improved cluster light assignment performance Co-authored-by: robtfm <50659922+robtfm@users.noreply.github.com> Co-authored-by: Carter Anderson <mcanders1@gmail.com>
# Objective - Fixes bevyengine#4234 - Fixes bevyengine#4473 - Built on top of bevyengine#3989 - Improve performance of `assign_lights_to_clusters` ## Solution - Remove the OBB-based cluster light assignment algorithm and calculation of view space AABBs - Implement the 'iterative sphere refinement' algorithm used in Just Cause 3 by Emil Persson as documented in the Siggraph 2015 Practical Clustered Shading talk by Persson, on pages 42-44 http://newq.net/dl/pub/s2015_practical.pdf - Adapt to also support orthographic projections - Add `many_lights -- orthographic` for testing many lights using an orthographic projection ## Results - `assign_lights_to_clusters` in `many_lights` before this PR on an M1 Max over 1500 frames had a median execution time of 1.71ms. With this PR it is 1.51ms, a reduction of 0.2ms or 11.7% for this system. --- ## Changelog - Changed: Improved cluster light assignment performance Co-authored-by: robtfm <50659922+robtfm@users.noreply.github.com> Co-authored-by: Carter Anderson <mcanders1@gmail.com>
Bevy version
latest (8630b19)
Operating system & version
OS: Artix Linux x86_64
Linux Kernel: 5.17.2-zen2-1-zen
GPU: NVIDIA GeForce 920MX
Nvidia driver: 510.60.02-1
What you did
Loaded a glTF scene with an orthographic camera and a point light in it:
To test and experiment with this, edit the
zfar
field of the camera in the file provided:ortho10.gtlf
What you expected to happen
Proper lighting
What actually happened
Lighting behaving strangely on different
far
settings of the orthographic camera set in Blender:30
50
100
1000
Additional Information
Note that at a 1000, the lighted parts of the scene are not visible in a 16:9 window and I had to stretch it. In #4005, the light was being "cutoff" because the
far
value was not loaded from glTF, and by default, it was being set to 0. Same thing is happening here.The text was updated successfully, but these errors were encountered: