Chaos Corona Forum

Chaos Corona for Cinema 4D => [C4D] I need help! => Topic started by: TeoRossi93 on 2020-01-20, 17:56:24

Title: How to use Zdepth in Cinema4d?
Post by: TeoRossi93 on 2020-01-20, 17:56:24
Hey guys, I can't figure out how to setup zdepth pass correctly and i can't find documentation about it.
I have my zdepth pass in the multipass tab, I set the minimum and maximum z depth according to my camera settings but I do get complete black zdepth pass.
Any quick tutorial on how to set this up correctly?
Title: Re: How to use Zdepth in Cinema4d?
Post by: houska on 2020-01-20, 18:09:29
Can you post a screenshot of your setup?
Title: Re: How to use Zdepth in Cinema4d?
Post by: TeoRossi93 on 2020-01-20, 21:05:50
Can you post a screenshot of your setup?
I've managed to make it work, I put some random parameters on the zdepth pass channel. I still have to understand how to approach it properly.
Title: Re: How to use Zdepth in Cinema4d?
Post by: TomG on 2020-01-20, 21:15:29
At a guess, those numbers aren't random :) 0 being the near point (black) and 20cm being the far point (white) seems like reasonable values for a small scale scene. If you lower the Max Z, more of the watch will get brighter (the far point for pure white gets closer, things don't need to be so far away to reach full white).

Those numbers always depend on the scale of the scene - a watch, a living room, a street, will all need different min and max values based on their scale. Out of interest, what were those values when it wasn't working?

Thanks!
Title: Re: How to use Zdepth in Cinema4d?
Post by: TeoRossi93 on 2020-01-20, 21:27:44
At a guess, those numbers aren't random :) 0 being the near point (black) and 20cm being the far point (white) seems like reasonable values for a small scale scene. If you lower the Max Z, more of the watch will get brighter (the far point for pure white gets closer, things don't need to be so far away to reach full white).

Those numbers always depend on the scale of the scene - a watch, a living room, a street, will all need different min and max values based on their scale. Out of interest, what were those values when it wasn't working?

Thanks!
I thought that those values were somehow linked to the camera parameters (DOF Map front and rear blur) :)
Title: Re: How to use Zdepth in Cinema4d?
Post by: TomG on 2020-01-20, 21:32:41
I got my blacks and whites mixed up in the previous post :)

If you set them to use Camera Clipping rather than typing in values, you should see those fields get populated. From a quick test, then the Max Z will be derived from the farthest object visible on screen (you'll be able to see the value there, even though it's greyed out and can't be overwritten). Would be interesting to see what value you were getting - was there perhaps some other object other than the watch in there, maybe a background card, ground plane, a light, something like that?

EDIT - looks like having a C4D Background object could affect it too
Title: Re: How to use Zdepth in Cinema4d?
Post by: TeoRossi93 on 2020-01-21, 11:15:21
I got my blacks and whites mixed up in the previous post :)

If you set them to use Camera Clipping rather than typing in values, you should see those fields get populated. From a quick test, then the Max Z will be derived from the farthest object visible on screen (you'll be able to see the value there, even though it's greyed out and can't be overwritten). Would be interesting to see what value you were getting - was there perhaps some other object other than the watch in there, maybe a background card, ground plane, a light, something like that?

EDIT - looks like having a C4D Background object could affect it too

Interesting, with clipping the zdepth pass is perfectly linked to the camera; I will do some tests later
Btw only watch in the scene (and lights of course), no background, bounce cards or other stuff.