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
Upscaling & Denoise filters causes browser sources to lose transparency #646
Comments
I'm unsure if I want to treat it as a bug so far, since these effects don't scale transparency as well as color, so the transparency channel is quite literally undefined. This is true for every single upscaling algorithm I know, none of them consider transparency in an image. So what would the expected result here be, since we have nothing to scale the transparency with? Just simply interpolate with linear sampling?
You are correct that the underlying NVIDIA Super Resolution network only supports certain scale factors, to which StreamFX snaps. Any unsupported resolution will cause the network to fail initialization, which results in the out-of-bounds rendering. |
Linear sampling could work, or the more complicated (and probably unnecessary way) would be to make it take the alpha channel, run it through a separate denoising instance, then apply it back as an alpha channel to the original source's output.
That makes sense. I'm not sure if there's a worthy tradeoff to making so the source is upscaled to the next available multiplying factor, then downscale it back to the defined percentage. The "how worth it is to spend resources upscaling and then downscaling again" thing is definitely an issue, although I presume in some scenarios it's worth it, while in others it's not. |
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
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
The problem with that is that there is no defined list of resolutions explicitly supported, and the network fails if it's off by as little as 1px in any direction. Which is a bit difficult to detect without reloading the effect, and that takes a fraction of a second - so it would introduce a noticable hitch every time you move the slider. |
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
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
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
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
Operating System
Windows 10 1903 and higher
OBS Studio Version?
27.1
StreamFX Version
0.11.0a4
OBS Studio Log
https://github.com/Xaymar/obs-StreamFX/files/7289391/2021-10-05.14-48-08.txt
OBS Studio Crash Log
No response
Current Behavior
When using the new Upscaling or Denoise filters on Browser sources, the Browser source loses any existing transparency.
This was moved from #642 as this issue is related to but is different from that issue.
Expected Behavior
Browser sources should not lose any of their transparency when applying an Upscaling or a Denoise filter to them.
Steps to Reproduce the Bug
Any additional Information we need to know?
The Denoise filter always removes the Browser source's transparency, regardless of it's settings.
The Upscaling filter strangely only causes this issue when the "Scale" option is set to 141.67% or higher - anything lower and the issue is not present. Similarly to what happens in #642 , the Browser source will shift in size, but only when the "Scale" option is set to 141.67% or higher. This seems to be more of an issue where the upscaling does not occur until a specific threshold is reached, as the size of the Browser source updates again when hitting a Scale value of 175.01%, and again at 250.01%.
My understanding is that since the Nvidia upscaling technology upscales in specific intervals (1.5x, 2x, 2.5x, etc.) and StreamFX only upscales the source when it reaches those multiples.
The text was updated successfully, but these errors were encountered: