Page 1 of 2

Z-pass depth map

Posted: Wed Feb 24, 2021 11:05 pm
by josephmcs
Hi all,

I have a fairly simple question. How can I render a z-pass depth map in Luxcorerender? I want to use it to apply mist in Photoshop instead of the compositing tab. I'm not getting great results with the mist feature under the camera settings, so I don't want to do that.

Many many thanks
J

Re: Z-pass depth map

Posted: Thu Feb 25, 2021 12:43 am
by Shantarli
I believe it's "depth" pass you are looking for.

Re: Z-pass depth map

Posted: Thu Feb 25, 2021 1:31 am
by josephmcs
I think so too, but when I try to do that, I get a very flat result (see attached).

Re: Z-pass depth map

Posted: Thu Feb 25, 2021 1:40 am
by Dade
josephmcs wrote: Thu Feb 25, 2021 1:31 am I think so too, but when I try to do that, I get a very flat result (see attached).
The depth AOV is an HDR image, I have the feeling you assume the values are between 0.0 and 1.0 (while it is between 0.0 and +INF).

Re: Z-pass depth map

Posted: Thu Feb 25, 2021 1:47 am
by josephmcs
Where can I change those settings? I don't see anything about it in the documentation.

Re: Z-pass depth map

Posted: Thu Feb 25, 2021 6:45 am
by B.Y.O.B.
There are no settings for the depth AOV.
If you need another range, you will have to remap the values into it, for example in the Blender compositor (it has a remap node).

Re: Z-pass depth map

Posted: Thu Feb 25, 2021 2:49 pm
by kintuX
Cycles does the same thing.
As noted, you must remap it to your 'intent'.
Generally, the easiest way is to 'Normalize' it (pass it through Vector > Normalize node).

Enjoy 8-)

Normalize Depth Pass LuxCore.jpg

Re: Z-pass depth map

Posted: Fri Jul 16, 2021 9:42 am
by bartek_zgo
Hi guys. I have a problem with depth of the background. I set HDRI background (I have tested with constant color too) and the strange thing is, that the distance for all pixels covered by sky is 0. I thought that I will find there something like infinity. After normalize, in my opinion, the sky should be white. Am I missing some settings for background?
depthBuffer_render.png
depthBuffer_depth.png
The png depth image is normalized. In attachment you can find exr that is the original output from luxcore.

If this is not a trivial thing, let me know and I will send you my scene.

BTW it would be nice to have a possibility to publish on a forum exr files directly without zip. I know that it is not trivial to display it, but it could work like with zip files.

Re: Z-pass depth map

Posted: Fri Jul 16, 2021 12:56 pm
by bartek_zgo
It is more than strange. I have created simple scene in blender. Open image with composer and made normalization:
Capture_01.PNG
Everything is OK. Than I export the scene with Luxcore FileSaver and render with standalone. Open with gimp:
Capture_02.PNG
As you can see in Blender the sky is white, in gimp black.

Re: Z-pass depth map

Posted: Fri Jul 16, 2021 8:02 pm
by Dade
The value is set to infinity: https://github.com/LuxCoreRender/LuxCor ... r.cpp#L426

However there are many conversions and factors from there that may affect your end result like FP 32 to 16, etc.