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

Fully transparent pixel-sized-holes in alpha channel in fully opaque render. #536

Closed
juangea opened this issue May 25, 2021 · 25 comments
Closed
Assignees
Labels

Comments

@juangea
Copy link

juangea commented May 25, 2021

I'm getting some fully transparent pixels in my renders, it was hard to notice at first, but when I used the result for compositing, using a bright image behind the darker interior showed some pixels, I mention them as fireflies because they are single pixels, but it's not fireflies, it's more like holes in the alpha, holes of the size of a pixel.

This becomes obvious when I force the contrast in a scene that should not allow a single transparent pixel:

Render:

image

Alpha channel contrasted to make the problem more visible, make a zoom if you don't see the white pixel, the pixel-holes does not repeat from render to render, they are different:

image

Here is the blend file I used for this example, the composite in the compositor is the alpha to make the problem visible:

alpha_bug.zip

@Dade916
Copy link
Member

Dade916 commented May 26, 2021

Your test scene has not enabled alpha channel at all. Am I missing something ?

@Dade916 Dade916 self-assigned this May 26, 2021
@juangea
Copy link
Author

juangea commented May 26, 2021

It should have the transparent background enabled in the camera, and you see the alpha as black because it's inverted due to the color ramp, just to make the pixel more visible, here is another picture:

image

The alpha should be fully opaque (with the color ramp, fully black), but it has some white pixels, in more complex scenes they are like pixel-holes in the render.

Just in case I uploaded the wrong .blend I'll upload it again, this time I made 100% sure that this is the correct Blend I show you in the picture:

alpha_bug_2.zip

@Dade916
Copy link
Member

Dade916 commented May 26, 2021

Alpha is not enabled in LuxCore AOVs panel and it is not configured through LuxCore API. Does it happen if you enable Alpha in AOVs pannel ?

This may be a bug in BlendLuxCore, it may ask for a not configure AOV and get just garbage.

@Theverat
Copy link
Member

Theverat commented May 26, 2021

When "use transparent film" is enabled, the ALPHA AOV is added:

https://github.com/LuxCoreRender/BlendLuxCore/blob/b7c61706f7f0f9a3cacb78f283a8cafc548378c9/export/aovs.py#L84

@Dade916
Copy link
Member

Dade916 commented May 26, 2021

Do you use different code for the FILESAVER ? Alpha is not enabled when exporting the scene.

@juangea
Copy link
Author

juangea commented May 26, 2021

@Dade916 you can enable the Alpha AOV if you want, there should not be any difference, just that when you export you have the AOV, but in my render the Alpha is enabled, so enable it anyways :)

@Theverat
Copy link
Member

Do you use different code for the FILESAVER ? Alpha is not enabled when exporting the scene.

Yes, transparent film is ignored when using filesaver.

@Dade916
Copy link
Member

Dade916 commented May 27, 2021

I should have fixed the problem.

@Dade916 Dade916 added the bug label May 27, 2021
@juangea
Copy link
Author

juangea commented May 27, 2021

Thanks @Dade916 I’ll test this tomorrow and confirm the fix :)

@juangea
Copy link
Author

juangea commented May 30, 2021

I`m not sure this is entirely solved, now I-m getting alpha transparency in fully solid parts of the scene, I see this happening in vegetation materials, like grass or plants, here is an example:

Render section:

image

Render alpha:

image

This is the shader used for this plant, which is one of the obvious ones, nothing fancy:

image

image

@Dade916
Copy link
Member

Dade916 commented May 31, 2021

I solved the problem of the original test scene. That one looks like something different: it smells like a side effect of recent changes to alpha channel.

You should try:

  1. does it happen with v2.5 ?

  2. increase the max. total/specular/glossy depth in v2.6 to something very high, does it still happen ?

  3. a test scene with a quad with the wall material and an overlapping quad with the leaf material, does it still happen ?

@juangea
Copy link
Author

juangea commented May 31, 2021

Ok, I'll do these tests.

Ignore the previous picture, I was wrong, I'll do the tests and tell you something, I'll also try to send you a simple scene to reproduce it.

@juangea
Copy link
Author

juangea commented May 31, 2021

Ok, you have another PM in the forum with a scene with a cube that reproduces the exact problem :)

(Today you have two PM's from me with two different scenes with two different problems, it's being a prplific day hahaha)

I'll test this in 2.5 to see if it happens, but I have to render some scenes for today so I won't be able to install back 2.5 I think, I'll do it if I can :)

The problem still happens with the Path depth to 64 (in everything).

@Dade916
Copy link
Member

Dade916 commented Jun 1, 2021

Well, it is the result of using glossytranslucent: it transmits paths over an hemisphere so some of them will just hit the sky and set alpha according due to the recent changes (https://forums.luxcorerender.org/viewtopic.php?f=5&t=3568&start=10#p30294).

It works as you expected in the following cases:

  1. if you replace glossytranslucent with glossy material;
  2. if you set glossytranslucent transmission to black;
  3. if you use roughglass with appropriate parameters;

#1 and #2 will change a bit the look for a plant shown full screen (but, I'm pretty sure, not in your scene).

#3 may produce the correct result because, instead of using a diffuse transmission (i.e. over all the hemisphere), will use a glossy transmission (i.e. more "directional" if you use low roughness values so the paths will hit the solid background instead of been fired in random directions). However the reflections will be too sharp.

@Dade916
Copy link
Member

Dade916 commented Jun 1, 2021

A possible solution to the changes of https://forums.luxcorerender.org/viewtopic.php?f=5&t=3568&start=10#p30294 could be to set alpha only for specular or glossy transmissions (not for diffuse transmissions).

Dade916 added a commit that referenced this issue Jun 1, 2021
@Dade916
Copy link
Member

Dade916 commented Jun 1, 2021

A possible solution to the changes of https://forums.luxcorerender.org/viewtopic.php?f=5&t=3568&start=10#p30294 could be to set alpha only for specular or glossy transmissions (not for diffuse transmissions).

I applied this change to the sources, it seems to work well and it makes sense.

@juangea
Copy link
Author

juangea commented Jun 1, 2021

Great, but I think I won't be able to test it until @Theverat updates the addon, right?

@Dade916
Copy link
Member

Dade916 commented Jun 1, 2021

The Linux daily binaries should still be for v2.92 so you may be able to try it.

@juangea
Copy link
Author

juangea commented Jun 1, 2021

ah, ok, I'll test it on linux, but does it require some setting?

Because if we get alpha over translucent materials it renders translucency useless to recreate vegetation, and we cannot recreate vegetation withoout translucency :)

@Dade916
Copy link
Member

Dade916 commented Jun 1, 2021

No, it should work out of the box.

@juangea
Copy link
Author

juangea commented Jun 1, 2021

Unless the change is not yet in the build (it's from 2 minutes ago) The problem persists:

image

I think the only viable option is to have a setting in the material to enable / disable alpha behaviour, similar to what is done by Corona.

@juangea
Copy link
Author

juangea commented Jun 1, 2021

Think that it's normal to want alpah out of normal glass, but in general we don't need alpha from the translucency of a tree leave or from grass, but we actually need translucency.

@Dade916
Copy link
Member

Dade916 commented Jun 1, 2021

You are not using the correct version. The latest sources are working. You can check the status of builds here: https://dev.azure.com/LuxCoreRender/LuxCoreRender/_build

When they are all green, you can download the latest builds. I think Acasta69 reverted to Python v3.7 so Windows build will be usable too (when ready).

@juangea
Copy link
Author

juangea commented Jun 1, 2021

Understood, I'll repeate the test as soon as I see everything green.

Thanks!

@juangea
Copy link
Author

juangea commented Jun 1, 2021

DONE!

The translucent problem is gone, I'll do another test with a bigger scene, but it seems to be solved :)

@juangea juangea closed this as completed Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants