Skip to content
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

Update Camera's Frustum only when its GlobalTransform or CameraProjection changed #9092

Merged
merged 2 commits into from
Aug 10, 2023

Conversation

Selene-Amanita
Copy link
Member

@Selene-Amanita Selene-Amanita commented Jul 10, 2023

Objective

Update a camera's frustum only when needed.

Solution

Add change detection filter for GlobalTransform or T: CameraProjection in update_frusta, since those are the cases when the frustum needs to be updated.

Note

I don't think a migration guide and changelog are needed, but I'm not 100% sure, I could put something like "if you're fighting against update_frusta, you can do it only when there is a change to GlobalTransform or CameraProjection now", what do you think? It's not really a breaking change with a normal use case.

@Selene-Amanita Selene-Amanita added A-Rendering Drawing game state to the screen A-ECS Entities, components, systems, and events C-Performance A change motivated by improving speed, memory usage or compile times C-Usability A targeted quality-of-life change that makes Bevy easier to use labels Jul 10, 2023
@Selene-Amanita Selene-Amanita modified the milestones: 0.12, 0.11.1 Jul 10, 2023
@cart cart added this pull request to the merge queue Aug 10, 2023
Merged via the queue into bevyengine:main with commit 77824b9 Aug 10, 2023
25 checks passed
cart pushed a commit that referenced this pull request Aug 10, 2023
…aProjection` changed (#9092)

# Objective

Update a camera's frustum only when needed.

- Maybe a performance gain from not having to compute frusta when not
needed, at the cost of change detection (?)
- Making "fighting" with `update_frusta` less tedious, see
#9077 and
https://discord.com/channels/691052431525675048/743663924229963868/1127566087966433322

## Solution

Add change detection filter for `GlobalTransform` or `T:
CameraProjection` in `update_frusta`, since those are the cases when the
frustum needs to be updated.

## Note

I don't think a migration guide and changelog are needed, but I'm not
100% sure, I could put something like "if you're fighting against
`update_frusta`, you can do it only when there is a change to
`GlobalTransform` or `CameraProjection` now", what do you think? It's
not really a breaking change with a normal use case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events A-Rendering Drawing game state to the screen C-Performance A change motivated by improving speed, memory usage or compile times C-Usability A targeted quality-of-life change that makes Bevy easier to use
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants