Z-pass depth map

Use this forum for general user support and related questions.
Forum rules
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
josephmcs
Posts: 23
Joined: Mon Feb 01, 2021 7:02 am

Z-pass depth map

Post by josephmcs » Wed Feb 24, 2021 11:05 pm

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

Shantarli
Posts: 10
Joined: Fri Jun 19, 2020 6:05 pm

Re: Z-pass depth map

Post by Shantarli » Thu Feb 25, 2021 12:43 am

I believe it's "depth" pass you are looking for.

josephmcs
Posts: 23
Joined: Mon Feb 01, 2021 7:02 am

Re: Z-pass depth map

Post by josephmcs » 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).
Attachments
Screen Shot 2021-02-24 at 8.30.01 PM.png
Screen Shot 2021-02-24 at 8.29.49 PM.png

User avatar
Dade
Developer
Posts: 5524
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Z-pass depth map

Post by Dade » Thu Feb 25, 2021 1:40 am

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).
Support LuxCoreRender project with salts and bounties

josephmcs
Posts: 23
Joined: Mon Feb 01, 2021 7:02 am

Re: Z-pass depth map

Post by josephmcs » Thu Feb 25, 2021 1:47 am

Where can I change those settings? I don't see anything about it in the documentation.

User avatar
B.Y.O.B.
Developer
Posts: 4125
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Z-pass depth map

Post by B.Y.O.B. » Thu Feb 25, 2021 6:45 am

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).

kintuX
Posts: 710
Joined: Wed Jan 10, 2018 2:37 am

Re: Z-pass depth map

Post by kintuX » Thu Feb 25, 2021 2:49 pm

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

bartek_zgo
Posts: 81
Joined: Mon Oct 26, 2020 11:42 am

Re: Z-pass depth map

Post by bartek_zgo » Fri Jul 16, 2021 9:42 am

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.
Attachments
depthBuffer_depth.zip
(85.15 KiB) Downloaded 27 times

bartek_zgo
Posts: 81
Joined: Mon Oct 26, 2020 11:42 am

Re: Z-pass depth map

Post by bartek_zgo » Fri Jul 16, 2021 12:56 pm

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.

User avatar
Dade
Developer
Posts: 5524
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Z-pass depth map

Post by Dade » Fri Jul 16, 2021 8:02 pm

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.
Support LuxCoreRender project with salts and bounties

Post Reply