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

Replaced implicit emissive weight with default. #13871

Merged

Conversation

dragostis
Copy link
Contributor

Since StandardMaterial::emissive_exposure_weight does not get packed into the gbuffer in the deferred case, unpacking uses an implicit default value for emissive's alpha channel.

This resulted in divergent behavior between the forward and deferred renderers when using standard materials with default emissive_exposure_weight, this value defaulting to 0.0 in the forward case and 1.0 in the other.

This patch changes the implicit value in the deferred case to 0.0 in order to match the behavior of the forward renderer. However, this still does not solve the case where emissive_exposure_weight is not 0.0.

Since StandardMaterial::emissive_exposure_weight does not get
packed into the gbuffer in the deferred case, unpacking uses an
implicit default value for emissive's alpha channel.

This resulted in divergent behavior between the forward and
deferred renderers when using standard materials with default
emissive_exposure_weight, this value defaulting to 0.0 in the
forward case and 1.0 in the other.

This patch changes the implicit value in the deferred case to 0.0
in order to match the behavior of the forward renderer. However,
this still does not solve the case where emissive_exposure_weight
is not 0.0.
@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen C-Code-Quality A section of code that is hard to understand or change and removed C-Bug An unexpected or incorrect behavior C-Code-Quality A section of code that is hard to understand or change labels Jun 16, 2024
@alice-i-cecile alice-i-cecile added the S-Needs-Review Needs reviewer attention (from anyone!) to move forward label Jun 17, 2024
@JMS55 JMS55 added this to the 0.15 milestone Jul 10, 2024
Copy link
Contributor

@pcwalton pcwalton left a comment

Choose a reason for hiding this comment

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

Seems fine, not ideal but an improvement on what we have.

@alice-i-cecile alice-i-cecile added the M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide label Jul 14, 2024
Copy link
Contributor

It looks like your PR is a breaking change, but you didn't provide a migration guide.

Could you add some context on what users should update when this change get released in a new version of Bevy?
It will be used to help writing the migration guide for the version. Putting it after a ## Migration Guide will help it get automatically picked up by our tooling.

Copy link
Member

@janhohenheim janhohenheim left a comment

Choose a reason for hiding this comment

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

Agreed, it's at least better than the status quo

@janhohenheim janhohenheim 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 Sep 5, 2024
@JMS55
Copy link
Contributor

JMS55 commented Sep 5, 2024

I don't know that we should merge this until #14599 is finished.

@Soulghost
Copy link
Contributor

Soulghost commented Sep 5, 2024

I don't know that we should merge this until #14599 is finished.

It's fine. If this code is merged before #14599 , I can premultiply the lightmap_data with view_bindings::view.exposure to resolve the confliction. On the other hand, this PR will require some adaptation work.

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Sep 9, 2024
Merged via the queue into bevyengine:main with commit 4b78ba0 Sep 9, 2024
35 checks passed
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 M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide 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.

6 participants