-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Refactor check_light_mesh_visibility for performance #2 #13906
Conversation
Marking as draft until #13905 get merged. |
Co-authored-by: Kristoffer Søholm <k.soeholm@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok to me now, and I tested that many_cubes with shadows still works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not super familiar with this code, but the implementation makes sense to me and the perf gain look pretty good.
I tested various examples and they all seemed to work correctly.
Objective
Solution
check_dir_light_mesh_visibility defers setting the entity's
ViewVisibility
so that Bevy can schedule it to run in parallel withcheck_point_light_mesh_visibility
.Reduce HashMap lookups for directional light checking as much as possible
Use
par_iter
to parallelize the checking process within each system.