-
Notifications
You must be signed in to change notification settings - Fork 168
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 an example of denoising an image with its alpha channel preserved #124
Comments
I cannot reproduce the issue with the latest version ( |
With denoising enabled and both strides set to 16, this is the lightmap I get: When denoising is disabled (which results in the expected appearance for the color and alpha channel), this is the lightmap I get: The shadowmask is stored in the alpha channel, with an alpha of 0% being "fully occluded" and 100% being "not occluded at all".
I'm using 1.1.0 because it's the last version that doesn't require ISPC to be compiled. (Apologies, but we can't use ISPC for various reasons such as the added complexity.) |
It looks like it's not just the alpha channel what's wrong but the color as well. Is this indeed the case? I could not reproduce the issue with |
How do you disable the denoiser to get the correct second image? Do you just skip calling your |
For context, I'm working on a Godot pull request that adds shadowmasking to the CPU lightmapper, which uses OpenImageDenoise. The shadowmask is stored in the lightmap's alpha channel to prevent the need to use a separate texture (which adds a whole lot of complexity). However, if I enable the denoiser, this alpha channels is lost when the image is denoised.
I've tried the following to allow preserving the alpha channel of the input image:
I'm not sure I understand what size to pass as a stride. My image data is always
Image::FORMAT_RGBAF
(floating-point RGBA with 32 bpc precision).I've tried different values such as
4
,8
,12
,16
but they all resulted in an error message (LightmapDenoiser: pixel stride smaller than pixel size
), or an image that looked corrupted. I've also tried specifying different strides for the"color"
and"output"
images to no avail.Would it be possible to add a code sample to the README that describes how to preserve an image's alpha channel, assuming the image uses RGBAF format (not ARGBF)? Thanks in advance 🙂
The text was updated successfully, but these errors were encountered: