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

AtlasEngine: Fix grayscale blending shader #12734

Merged
1 commit merged into from
Mar 23, 2022
Merged

Conversation

lhecker
Copy link
Member

@lhecker lhecker commented Mar 21, 2022

5964060 contains a regression were the grayscale blending algorithm used the
gamma corrected foreground color as the pixel color, instead of blending that
color with the background color first. Due to that the background color
got lost / got set to black. This breaks any dark-on-bright outputs.

PR Checklist

  • I work here
  • Tests added/passed

Validation Steps Performed

All 3 "antialiasing" settings work just like in DxEngine. ✅

@lhecker
Copy link
Member Author

lhecker commented Mar 21, 2022

DxEngine left - AtlasEngine right

aliased:
image

grayscale:
image

cleartype:
image

(ClearType is hard to see for colored text. You can see it on the white-on-black text.)

Comment on lines +150 to +151
float4 alphaCorrected = DWrite_ApplyAlphaCorrection(contrasted, intensity, gammaRatios);
color = alphaBlendPremultiplied(color, alphaCorrected * fg);
Copy link
Member Author

Choose a reason for hiding this comment

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

Here's a direct link showing the old code using alphaBlendPremultiplied here: 5964060#diff-ca02942b22b9baa16bcef607b524e1e4590793109f302c097b6705f0d1383310L135

@lhecker lhecker added Issue-Bug It either shouldn't be doing this or needs an investigation. AutoMerge Marked for automatic merge by the bot when requirements are met Area-AtlasEngine labels Mar 23, 2022
@ghost
Copy link

ghost commented Mar 23, 2022

Hello @lhecker!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit 73f0202 into main Mar 23, 2022
@ghost ghost deleted the dev/lhecker/atlas-engine-fixup branch March 23, 2022 23:48
@ghost
Copy link

ghost commented May 24, 2022

🎉Windows Terminal Preview v1.14.143 has been released which incorporates this pull request.:tada:

Handy links:

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-AtlasEngine AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants