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

Restore Alpha after Upscaling and Denoising #651

Merged
merged 3 commits into from Oct 6, 2021
Merged

Restore Alpha after Upscaling and Denoising #651

merged 3 commits into from Oct 6, 2021

Conversation

Xaymar
Copy link
Owner

@Xaymar Xaymar commented Oct 6, 2021

Explain the Pull Request

None of the currently known Upscaling and Denoising algorithms handle Alpha, and some destroy the Alpha channel entirely. Instead of hoping to get a proper result from these, we should restore the Alpha channel manually and linearly interpolate it when necessary.

Why is this necessary?

Alpha channel was destroyed when Denoising or Upscaling was applied.

Checklist

  • I will become the maintainer for this part of code.
  • I have tested this code on all supported Platforms.

Related Issues

There are a number of duplicate shader routines we should combine into a single shader to save disk space, and remove unexpected errors in one copy but not the other.
As the Alpha channel is completely ignored and possibly destroyed by denoising algorithms, we should restore the Alpha channel manually. Linear interpolation was chosen here as it will behave like Point if the size matches, and properly interpolate if the size doesn't match.

Fixes: #646
As none of the known Upscaling algorithms handle Alpha, we need to manually restore and interpolate it properly. While this technically reduces visual quality slightly, the chances of this being noticed are slim to none considering that Upscaling is already a questionable solution to quality. Linear was picked here as it produces the best overall result for scaling, keeping gradients mostly in one piece. Mostly.

Fixes #646
@Xaymar Xaymar merged commit e109e61 into master Oct 6, 2021
@Xaymar Xaymar deleted the patch-maxine branch October 6, 2021 01:08
@Xaymar Xaymar added verified Contents of this Issue were confirmed to happen as described. type:fix labels Oct 6, 2021
@Xaymar Xaymar added this to the Machine Learning Components milestone Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
verified Contents of this Issue were confirmed to happen as described.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant