Skip to content

fix(Rect Lights): rect_lights should be written out to GpuLights#24024

Merged
alice-i-cecile merged 1 commit intobevyengine:mainfrom
kfc35:23997_fix_rect_lights
Apr 29, 2026
Merged

fix(Rect Lights): rect_lights should be written out to GpuLights#24024
alice-i-cecile merged 1 commit intobevyengine:mainfrom
kfc35:23997_fix_rect_lights

Conversation

@kfc35
Copy link
Copy Markdown
Contributor

@kfc35 kfc35 commented Apr 29, 2026

Objective

Solution

  • Move the statement that writes gpu_lights after the code block that sets rect_light information within gpu_lights. If only all the rendering bugs were this easy...

Testing

  • cargo run --example rect_light --features=“free_camera” works again
Screenshot 2026-04-28 at 11 08 32 PM

@kfc35 kfc35 added C-Bug An unexpected or incorrect behavior D-Trivial Nice and easy! A great choice to get started with Bevy A-Rendering Drawing game state to the screen S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 29, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in Rendering Apr 29, 2026
@kfc35 kfc35 added this to the 0.19 milestone Apr 29, 2026
@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 29, 2026
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Apr 29, 2026
Merged via the queue into bevyengine:main with commit b56726a Apr 29, 2026
49 checks passed
@github-project-automation github-project-automation Bot moved this from Needs SME Triage to Done in Rendering Apr 29, 2026
pull Bot pushed a commit to octoape/bevy that referenced this pull request Apr 29, 2026
# Objective

- Regression test for broken Rect Lights

## Solution

- Add a rectangular light to testbed/3d

## Testing

- `cargo run --example testbed_3d` - I can see the new light (well,
after bevyengine#24024 is merged hehe)

Before (w/o rect light)
<img width="1271" height="747" alt="Screenshot 2026-04-28 at 11 28
16 PM"
src="https://github.com/user-attachments/assets/aa6b6258-e80d-4a98-861c-bcad6e8db541"
/>

After (w/ rect light - it’s behind the cube)
<img width="1271" height="750" alt="Screenshot 2026-04-28 at 11 25
33 PM"
src="https://github.com/user-attachments/assets/877013f0-843a-43f2-9dbd-96f2fa37d8e2"
/>
tychedelia pushed a commit to processing/bevy that referenced this pull request Apr 30, 2026
…evyengine#24024)

# Objective

- The `rect_light` half of bevyengine#23997 

## Solution

- Move the statement that writes `gpu_lights` *after* the code block
that sets rect_light information within `gpu_lights`. If only all the
rendering bugs were this easy...

## Testing

- `cargo run --example rect_light --features=“free_camera”` works again

<img width="1271" height="744" alt="Screenshot 2026-04-28 at 11 08
32 PM"
src="https://github.com/user-attachments/assets/84018902-1f70-4a8c-9e16-982d156fb8b4"
/>
tychedelia pushed a commit to processing/bevy that referenced this pull request Apr 30, 2026
# Objective

- Regression test for broken Rect Lights

## Solution

- Add a rectangular light to testbed/3d

## Testing

- `cargo run --example testbed_3d` - I can see the new light (well,
after bevyengine#24024 is merged hehe)

Before (w/o rect light)
<img width="1271" height="747" alt="Screenshot 2026-04-28 at 11 28
16 PM"
src="https://github.com/user-attachments/assets/aa6b6258-e80d-4a98-861c-bcad6e8db541"
/>

After (w/ rect light - it’s behind the cube)
<img width="1271" height="750" alt="Screenshot 2026-04-28 at 11 25
33 PM"
src="https://github.com/user-attachments/assets/877013f0-843a-43f2-9dbd-96f2fa37d8e2"
/>
kfc35 added a commit to kfc35/bevy that referenced this pull request Apr 30, 2026
…ight` has changed (bevyengine#24038)

# Objective

- Fixes bevyengine#23997 for `spotlight` (`rect_light` fixed with bevyengine#24024 already)
- The spotlight example changes the transform of each spotlight, but the
`ExtractedView` and the `Frustum` for the spotlight never updates, hence
why the light doesn’t look complete for subsequent frames.

## Solution

- For Spot lights (and Point lights since those were also affected),
update the `ExtractedView` and the `Frustum` if its corresponding
`ExtractedPointLight` has changed.
- AFAIK this isn’t needed for Directional lights because
`ExtractedView`s aren’t re-used — they’re made anew in `prepare_lights`

## Testing

- `cargo run --example spotlight` works as desired.
- `cargo run --example async_channel_pattern` works as desired (for
PointLight testing)
- @Zeophlite assist with the example runner (was done before the frusta
change though)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior D-Trivial Nice and easy! A great choice to get started with Bevy S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants