Make FOG_ENABLED a shader_def instead of material flag#13783
Merged
alice-i-cecile merged 1 commit intobevyengine:mainfrom Jun 10, 2024
Merged
Make FOG_ENABLED a shader_def instead of material flag#13783alice-i-cecile merged 1 commit intobevyengine:mainfrom
alice-i-cecile merged 1 commit intobevyengine:mainfrom
Conversation
robtfm
approved these changes
Jun 9, 2024
Contributor
robtfm
left a comment
There was a problem hiding this comment.
makes sense, fog tends to be all or nothing so this is unlikely to make more shader variants in any real world scenarios, and saves some registers when not used.
i think keeping the other flags unchanged and commenting the old fog flag as unused is the right call as well.
coreh
reviewed
Jun 9, 2024
coreh
approved these changes
Jun 9, 2024
JMS55
approved these changes
Jun 10, 2024
mockersf
pushed a commit
that referenced
this pull request
Jun 10, 2024
# Objective - If the fog is disabled it still generates a useless branch which can hurt performance ## Solution - Make the flag a shader_def instead ## Testing - I tested enabling/disabling fog works as expected per-material in the fog example - I also tested that scenes that don't add the FogSettings resource still work correctly ## Review notes I'm not sure how to handle the removed material flag. Right now I just commented it out and added a not to reuse it instead of creating a new one.
Contributor
|
This wasn't done the right way, I don't think. What I suggested was to make the |
alice-i-cecile
pushed a commit
to alice-i-cecile/bevy
that referenced
this pull request
Jun 10, 2024
…ngine#13783)" This reverts commit 3ced49f.
mockersf
pushed a commit
that referenced
this pull request
Jun 11, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Solution
Testing
Review notes
I'm not sure how to handle the removed material flag. Right now I just commented it out and added a not to reuse it instead of creating a new one.