Skip to content

Skip bloom rendering if HDR is disabled#15856

Closed
akimakinai wants to merge 1 commit intobevyengine:mainfrom
akimakinai:bloom_retained2
Closed

Skip bloom rendering if HDR is disabled#15856
akimakinai wants to merge 1 commit intobevyengine:mainfrom
akimakinai:bloom_retained2

Conversation

@akimakinai
Copy link
Copy Markdown
Contributor

@akimakinai akimakinai commented Oct 11, 2024

Objective

Solution

  • Skip bloom rendering if !camera.hdr.

It seems that conditional extraction is no longer a valid pattern, because extract_component returning None will keep the previous value if it existed.

Testing

  • transmission example no longer crashes when toggling HDR

@alice-i-cecile alice-i-cecile added this to the 0.15 milestone Oct 11, 2024
@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen P-Crash A sudden unexpected crash labels Oct 11, 2024
@alice-i-cecile alice-i-cecile added the S-Needs-Review Needs reviewer attention (from anyone!) to move forward label Oct 11, 2024
Copy link
Copy Markdown
Member

@tychedelia tychedelia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a good check to have anyway, but I'm concerned about the component sticking around. Minimally we should be more careful in the future about using SyncToRenderWorld to guarantee cleanup.

github-merge-queue bot pushed a commit that referenced this pull request Oct 15, 2024
# Objective

Ensure that components that are conditionally extracted do not linger in
the render world when not extracted from the main world.

## Solution

If the `ExtractComponent` returns `None`, we'll remove the render world
component. I think this is the most sensible behavior here. In the
future if there really is a use case for keeping the previous render
component around, we could add a `Option<Self::Out>` parameter for the
previous render component to the method, or something similar. I think
that this follows the principle of least surprise here relative to what
`None` would suggest and the way that render nodes are typically
written. The alternative would be to add an `enabled` field to pretty
much every camera settings component, or duplicate the extraction
condition as #15856 does.

## Testing

`transmission` no longer crashes.

## Migration Guide

Components that implement `ExtractComponent` and return `None` will
cause the extracted component to be removed from the render world.
@akimakinai akimakinai closed this Oct 15, 2024
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 P-Crash A sudden unexpected crash S-Needs-Review Needs reviewer attention (from anyone!) to move forward

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants