-
Notifications
You must be signed in to change notification settings - Fork 705
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
Remove automatic value change when specifying luminosity opacity on AcrylicBrush #2017
Remove automatic value change when specifying luminosity opacity on AcrylicBrush #2017
Conversation
@SpencerHurd - please review the screenshots to ensure the visuals chingucoding is showing is what's desired for this Acrylic fix. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Following Spencer's description of the proposed change in the GitHub discussion for issue#1639, I would expect a change to this function, or GetEffectiveTintColor() above [to avoid applying any tintOpacityModifier to get the effective tint color in case TintLuminosityOpacity is set] Refers to: dev/Materials/Acrylic/AcrylicBrush.cpp:344 in 647dac8. [](commit_id = 647dac8, deletion_comment = True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GetEffectiveTintColor: there should be a change either here or in GetTintOpacityModifier to skip any modifications of TintColor when TintLuminosityOpacity is specified by the app.
For the calculation of the Luminosity color, the values specified for TintColor and TintOpacity are used as provided by user. From what I understood, only the luminosity color was not calculated correctly, thus this was the only change I made. |
} | ||
|
||
// To create the Luminosity blend input color without luminosity opacity, | ||
// we're taking the TintColor input, converting to HSV, and clamping the V between these values |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer you put the remainder of this function in an else block, I think it makes it easier to read at a glance than having to recognize the early return
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am personally more a fan of the "return early" pattern, but sure, I will change it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are still returning early but this puts the logic that is now in the else block at the correct indentation level. before this change its easier to look at the code that is now in the else block and assume it will be run regardless of whether or not the above if statement was executed or not. Now it is obvious from the indentation level that it will only be run if we do not meet the if statement.
In reply to: 386686086 [](ancestors = 386686086)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh haha, I see. So your preferred way would be have a variable and we either set it to the "normal" luminosity brush or run the calculations and return our saved variable at the end of the function? If you want I can still change that to only have one return at the end.
In GetEffectiveTintColor() we obtain the effective TintColor, and its Alpha is affected by luminosity via the tintOpacityModifier: That is the tint color we actually use in the recipe (sometimes directly, sometimes to determine if we're in the special case of 'opaque acrylic'): To complete the change, we can eg update line 339 to exclude the tintOpacityModifier term in the case that luminosityOpacity is provided. In reply to: 591684517 [](ancestors = 591684517) |
@DmitriyKomin I am not sure what's the right change is here, this is something @SpencerHurd (and possibly @chigy) need to decide. Sorry if I am CC'ing the wrong people here, I am not sure who exactly is the expert for that specifically 😅 |
@kikisaints , did we not receive actual recipe from design team when this was discussed originally? |
We received a design detailing the luminosity integration. Internally as the PM team we decided on a "fallback" behavior that was:
It looks like DI didn't implement this quite the way we had decided, resulting in some additional luminosity adjustments even when the property was set. I think this was to combat Shadows, but since the DI doesn't remember why it was adjusted and design is unhappy with it I'm inclined to remove it so 1 above operates as we originally intended. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@DmitriyKomin could you please take another look and approve if this is ready to go in? |
@SpencerHurd : can you review the PR overall and also look at my comment above requesting a change? I believe that is needed to achieve the behavior you outlined... |
Hi everyone, Dimitiry was kind enough to walk me through the code changes. It looks to me like two of the three alterations are being correctly suppressed when Luminosity Opacity is provided. So the desired LuminosityTintColor is being used, and the desired LuminosityTintOpacity is being used. However it looks like the TintOpacity is still being altered, which is undesirable. Thank you very much! |
Thanks for your feedback @SpencerHurd and @DmitriyKomin ! |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Thanks
Thanks! Looks good, I approved the PR. |
Description
Remove unwanted clamping/rounding of colors when luminosity opacity is set on acrylic brush.
Motivation and Context
Fixes #1639
How Has This Been Tested?
Added new test page for visual verification.
Screenshots (if appropriate):