3
$\begingroup$

I am trying to get the depth value using z pass from my scene which is a simple head model, but while rendering there is white salt and pepper noise in the hair and eyelash. I have saved in both png after normalizing and in openexr file with the raw data. While looking into it I figure it out that both the object are using alpha value from the diffuse and opacity texture file. Below are the composite pass I am using -

enter image description here

Following is the node editor for hair/eyelash object -

enter image description here

Following are the image and corresponding depth (z pass output) as png in with the original alpha values -

enter image description here

Then I manually edited the alpha channel value in the texture image of the hair: I edited the alpha as 255 where there is a alpha value present ( > 0)

enter image description here

This reduced the noise a lot but at the same time its reduce the rendering quality of the hair mesh as well -

enter image description here

I have also tested with changing the max bounces for transparency and transmission but it did not change the result

Is there any further solution of this issue...

Blend File Link :

https://drive.google.com/open?id=1LzJ-RiZzgxlY1aGHTTAAaS0OrGTseyvc

$\endgroup$
2
  • $\begingroup$ Does it make a difference if you connect the alpha socket from your texture to the alpha socket of the Principled BSDF and remove the Mix Shader and Transparent BSDF? $\endgroup$ Commented Nov 22, 2019 at 15:16
  • $\begingroup$ @Robert I tried but it's not giving any improvement in the z-pass result, I have added the blend file in the original post $\endgroup$
    – shubhajit
    Commented Nov 23, 2019 at 23:42

5 Answers 5

3
$\begingroup$

Switch to Branched Path Tracing

Switch the sampling method to Branched Path Tracing and set Min Transparent Bounces to 32 or higher to eliminate the noise.

enter image description here

Also, it is better to use Mist pass instead of Depth.

enter image description here

You need to map the value from 0-1 to 0-100, depending on your mist settings, to match the depth pass.

enter image description here

Thanks to skw Stefan Werner for the Branched Path Tracing hint. https://blenderartists.org/t/cycles-depth-and-mist-passes-for-a-transparent-material-give-a-lot-of-noise/1192751/5


Stay with Path Tracing

If you need to stay with Path Tracing, which seemingly ignores Min Transparent Bounces, you can create a new view layer with material override.

enter image description here

enter image description here

The material will be with Camera Data node and mixing by the object index N.

enter image description here

Change the object indexes of all the particle objects to N, easily with Copy to Selected.

enter image description here

It gives the same result as the mist pass.

enter image description here

$\endgroup$
10
  • $\begingroup$ Thanks, @unwave for your reply, I am pretty new to blender and using for my research purpose. I didn't get mixing by the object index part. In my case, there is only two object mesh one is the hair mesh and the other is the eyelash as I am importing this character from iclone. Could you please explain or provide some tutorials I can follow? I have also added my blend file in the original post for your reference. $\endgroup$
    – shubhajit
    Commented Nov 23, 2019 at 23:28
  • $\begingroup$ @shubhajit An object index is an integer value of an object you can give it to later access it in the shader and compositor node editors. I did some tests with EEVEE depth and mist passes and also a filtering of the flakes in the compositor. It gives usable results too. Can you specify what you are trying to achieve? $\endgroup$
    – unwave
    Commented Nov 24, 2019 at 19:18
  • $\begingroup$ Thanks @unwave for the explanation, I am trying to get the exact depth information in openexr format and their corresponding rgb images, I am importing these characters with from the iclone character creator pipeline in either alembic or fbx format and render it in blender with different camera positions and camera parameters. I have attached the blend file in the original post. $\endgroup$
    – shubhajit
    Commented Nov 24, 2019 at 19:34
  • 1
    $\begingroup$ @shubhajit Try this fix blenderartists.org/t/… or use EEVEE with Alpha Hashed. Set Mist Pass from 0 to 100 m, linear, and map range It from 0 - 1 to 0 - 100 in the compositor. You have to enable it first. It will appear in World Properties. $\endgroup$
    – unwave
    Commented Nov 25, 2019 at 20:56
  • 1
    $\begingroup$ @shubhajit Check the updated answer. It is easier, you don't need material override. $\endgroup$
    – unwave
    Commented Nov 28, 2019 at 9:08
2
$\begingroup$

Rounding alpha to integer

I'm late to the party but perhaps the answer can be still useful to someone.

So, z-depth and mist fireflies appear when, in cycles shading nodes, non-integer alpha is introduced(so, greater than 0 but lower than 1).

Before: z-depth fireflies

Given that anyway it's not possible for a z-depth and mist pixel to carry information of two distances at the same moment (with the exception of anti-aliasing in mist), a workaround specifically to this issue is to eliminate those half transparencies by rounding to integer before plugging in the mix shader node where transparency is introduced. You might want to render separately depending on your setup.

Fireflies b gone

$\endgroup$
2
$\begingroup$

I think I solved it for me, the first option option above did not work as the sampling method choice doesn't seem to exist anymore. But I get a perfect result in a couple of clicks doing this: Hope this helps, seems like perfectly smooth transparent Z depth

$\endgroup$
0
$\begingroup$

I stumbled across this solution for the scene I was working on. Go to render passes tab and set alpha threshold to 0. I could use the depth pass just fine with no fireflies after doing this. Hope it could also be useful to someone.

enter image description here

$\endgroup$
0
$\begingroup$

I think I kind of have fixed it by bumping up the samples for transparency to 128 i think also denoising the mist pass in composite should fix it further. It seems that the white bits are from lack of samples and the more samples you use, the less noise you get from the alpha( like tree leaves , windows etc) So answer 3 seems to be on the right path( no pun intended) Now its just case of finding the minimum amouunt of samples I can get away with. I used minimum light bounce of 3 and minimum transparent bounes of 3 with 128 samples for the max transparency bounces. looks ok, just a few left over noisy bits but not totally white and looks ok in the final comp enter image description here

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .