-
Notifications
You must be signed in to change notification settings - Fork 164
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
Add proper alpha channel support #140
Comments
The upcoming release of Open Image Denoise will add GPU support so it will be suitable for real-time applications even if the alpha channel would be denoised separately. Do you denoise the alpha channel separately regardless of the denoiser, or do you need a special code path only for Open Image Denoise? If Open Image Denoise would support denoising the alpha channel together with the RGB image, what would be your expectations regarding performance? |
For interactive rendering we are using the optix denoiser which just has an option to switch alpha denoising on or off with minimal performance impact (less than 10% if I remember correctly). We have both, the optix denoiser and the open image denoiser encapsulated in their own dll with a common interface so from the outside there is no special handling. Inside our open image denoiser wrapper we are calling the denoiser twice which also means we have do duplicate the alpha channel to a RGB image first, denoiser and then decomposite it again which additionally impacts performance. |
There are multiple modes for denoising the alpha channel in OptiX. Are you using |
We are using OPTIX_DENOISER_ALPHA_MODE_FULL_DENOISE_PASS since the OPTIX_DENOISER_ALPHA_MODE_ALPHA_AS_AOV mode is buggy and creates transparent areas in solid alpha cases. We are also still using the older HDR denoiser instead of the AOV denoiser since it delivers better quality (still worse than open image denoise though). |
This is quite surprising. I just looked up the latest OptiX documentation for
Which sounds like what you're doing manually with Open Image Denoise. So I'm wondering how does this have only 10% performance impact for you, instead of 2x? Perhaps the OptiX documentation is out-of-date? |
Mhhh..interesting. I will have to retest it, not sure if the measurement I did included all the additional setup as well. Will keep you posted. |
Thanks, it would be useful to know! Also, could you perhaps share a few representative noisy RGB + alpha images that we could internally use for testing? Feel free to contact me via email if you would prefer to share these privately. |
Ok, the timing was indeed my mistake. I measured the full denoiser run, including all the setup calls and so on. Additionally I figured out that the HDR-denoiser we use doesn´t support the OPTIX_DENOISER_ALPHA_MODE_ALPHA_AS_AOV. So if it would just be possible to handle the alpha denoising internally so we won´t have to manually copy the image to an extra buffer and copy the result back to the original image it would be ok if there would be 2 runs internally, especially if the GPU implementation will be a lot faster than the CPU implementation. About testing images: I will check it internally and contact you per mail. |
Thanks for the info! We will add alpha channel denoising support to the upcoming release: there will be an option to either denoise the alpha channel or copy it without changes. This will be initially implemented as an additional denoising step, and in future versions we may switch to a faster implementation. Regarding your current workflow with Open Image Denoise: do you denoise the alpha channel with the |
Thanks, that sounds good. At the moment yes, we have both hdr and srgb set to false. I tried switching hdr to on and didn´t see any difference though. Our color buffer is always denoised in hdr mode though. |
Thanks for confirming. The alpha channel should be denoised in LDR mode (HDR off), so what you're currently doing sounds good. |
Hello @atafra, regarding this issue. I just sent you privately 3x correlated exr images (beauty with alpha channel, normal and albedo). Further details on the e-mail. |
|
That sounds great, I will test it out as soon as possible. Thanks for implementing this. |
Hi, I am trying denoise the RGB and alpha from an EXR using version v2.1.0, but I am getting an error. Like @atafra mentioned above, in v2.1.0, all I need to do is to run 2 filters with the proper bytePixelStride to process the alpha channel. Here is my output:
Here is a simplified CLI code that I am using:
|
Are you sure that |
Hi, Yes, my input has all 4 channels and yes, I wrote that implementation based on the app oidnDenoise.cpp. Thanks |
You would need to modify the example app to load all 4 channels. The issue isn't with filter.setImage(). I think the error reported by OIDN is correct. |
I meant what is actually loaded in the |
Yes, after checking that, the format of the input was Half3. New output:
|
It seems you're using Half4 for both the RGB input and output. OIDN doesn't support 4 channel input/outputs, that's why there's a need for separate RGB and alpha filters. |
You mentioned that Sorry for so many questions. |
You already shared the code how to do it, by denoising RGB and alpha separately. The RGB input should have 3 channels but the verbose output says that it's 4 channels, which is wrong. |
Ok. Let me try more here. I will give you some feedback soon. Thanks for the pacience. |
At the moment only RGB channels are denoised, which means for a full result one has to create an rgb image from the alpha channel, denoise it and copy the result back to the final image. Considering that OpenImageDenoise is already quite slow compared to other denoiser this doubles the amount of computation time making OpenImageDenoise basically useless for realtime (30fps+) applications.
The text was updated successfully, but these errors were encountered: