Fix: Update the ExtractedView & Frustum when the ExtractedPointLight has changed#24038
Conversation
| .after(early_prepass_build_indirect_parameters) | ||
| .before(early_downsample_depth) | ||
| .before(per_view_shadow_pass::<LATE_SHADOW_PASS>), | ||
| .before(shared_shadow_pass::<LATE_SHADOW_PASS>), |
There was a problem hiding this comment.
this seemed like an oversight that I spotted so I just added this, it’s unrelated to the fix. I can remove this if desired but it’s small so I felt OK sneaking it in
point_and_spot_light_view_entities when the ExtractedPointLight has changedExtractedView when the ExtractedPointLight has changed
9fd3609 to
e78d3b4
Compare
|
Thanks @Zeophlite for the assist with the example runner! I inspected those results and learned that the frusta need to be included in the components to update, so I included those as well in the most recent commit. I also learned that the Now, the |
ExtractedView when the ExtractedPointLight has changedExtractedView & assoc. Frusta when the ExtractedPointLight has changed
ExtractedView & assoc. Frusta when the ExtractedPointLight has changedExtractedView & Frustum when the ExtractedPointLight has changed
Objective
spotlight(rect_lightfixed with fix(Rect Lights):rect_lightsshould be written out toGpuLights#24024 already)ExtractedViewand theFrustumfor the spotlight never updates, hence why the light doesn’t look complete for subsequent frames.Solution
ExtractedViewand theFrustumif its correspondingExtractedPointLighthas changed.ExtractedViews aren’t re-used — they’re made anew inprepare_lightsTesting
cargo run --example spotlightworks as desired.cargo run --example async_channel_patternworks as desired (for PointLight testing)