Fix: Send CurrentView/ an ExtractedCamera’s world position via immediates for gpu vis range culling#24197
Fix: Send CurrentView/ an ExtractedCamera’s world position via immediates for gpu vis range culling#24197kfc35 wants to merge 11 commits intobevyengine:mainfrom
CurrentView/ an ExtractedCamera’s world position via immediates for gpu vis range culling#24197Conversation
JMS55
left a comment
There was a problem hiding this comment.
Note: With this PR, we lose out on PreprocessingOnly support for WebGPU, until immediates are added to the spec and wgpu supports it.
|
I will add a marker component for the camera to use for gpu vis culling spot and point lights shadows, that should be ready to review in a few hours |
34ad77f to
3a800cd
Compare
|
Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke! If it's expected, please add the M-Deliberate-Rendering-Change label. If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it. |
a767075 to
3f8e38b
Compare
3f8e38b to
ac87f8e
Compare
Objective
Immediatesto avoid bloatingViewUniforms. There was also a concern about usingRetainedViewEntityto pass information about what camera to use along. This is that alternate implementation path.Solution
CurrentView(which either stores the current user camera OR the point/spot shadow camera) mechanism to get the current view’s world position. Use this for gpu vis range culling. This is the codepath directional light shadow views will take.RootNonCameraViews), a marker component has been added to denote the camera to use:PointAndSpotLightShadowPrimaryCamera. There must only be one camera with this component. This camera’s position is used for gpu vis range culling.ac87f8e and return back to just querying for extracted cameras and taking the first one returned by the query.
Note
Copying this comment from @JMS55:
With this PR, we lose out on PreprocessingOnly support for WebGPU, until immediates are added to the spec and wgpu supports it.
Testing
cargo run --example visibility_range -- --no-cpu-cullingworks with a directional light as desiredvisibility_rangeexample to be a Spot or PointLight like so:And added the
PointAndSpotLightShadowPrimaryCamerato theCamera3din the example, and then ran the example. The shadows of spot and point lights also look normal.