Match Z-Depth of particles and geometry?

Is it possible to exactly match the "Blended Z Depth" output with the geometry Z-Depth render element,
so that both depth channels have the same values at the same distances? If not, I think there should be
a function for this in Krakatoa. For example, if the particle color is set to "Blended Z Depth" there is
a button to tell Krakatoa to use the settings of the Z-Depth Channel in the "Render Elements" tab. Or better,
it automaticly renders the correct "Blended Z Depth" as second pass if a Z-Depth channel is present in the
"Render Elements" list.
This would be very useful for compositing, I think we should not have to guess the values.

Thanks

 

Hi Tom,



The Blended Z Depth produces an “unbiased” Depth Pass which contains the exact values in Generic Units stored in the color channels as Floats. This is, of course, not the way Z-Depth work in Max (because it was developed prior to floating point images and had to live with 256 levels of gray). It is the way Gelato outputs its Depth (and I assume Renderman renderers do the same), so we went with it. Gelato uses Blended Camera Distance, though.



In the future, we would like to get away from the current rigid structure and allow Krakatoa to output any number of Render Elements in one go (RGBA, Depth, Velocity, Normals, you name it). This will be most probably independent from the Max Render Elements though. It is planned, but not for 1.1 obviously.



Currently, a point at a distance of 1000 units contains the value of 1000.0 in its channel. If your Geometry Z-Depth was normalized between 0 and 10000 units, you would have to divide the Krakatoa Z-Depth channel by 10000 and the Z value will become 0.1, or in grayscale 255*0.1 = 25.5, hopefully matching your geometry pass. This requires the Gain to be set to 0.0001 (for example in Fusion or whatever your post app. is).



We currently provide INPUT for all Z-Depth formats. I guess it would be a good idea to provide OUTPUT in all possible formats, too.

Thanks Bobo, render elements in one pass, sounds great!smile
This “unbiased” Depth output is definitely the more flexible solution no doubt, but I think there
should be an extra option to output a Max compatible depth map too, which can easily combined
with the geometry z-depth channel of Max.

Problem is, 3ds max isn’t consistent, so it’s hard to match it. With render elements, it gets normalized to whatever the user sets as the min and max. Krakatoa won’t know what you set for that (and frankly, 2 weeks from now, neither will you).



The z-buffer output in 3ds max’s scanline renderer outputs actual z-depth. It’s negative, of course, I assume since what the camera sees is actually “behind” the camera’s pivot. That might not be the real reason though.



Perhaps Krakatoa should just output the values in the negative? Again, this is something pretty easy to change in the composite.



I tried to render a spherical B2cam to see if the blended z-depth would hold negative numbers behind the camera, but I couldn’t seem to render anything past 180 degrees. Is that expected?


  • Chad






>Perhaps Krakatoa should just output the values in the
>negative? Again, this is something pretty easy to change in
>the composite.

Hello Chad,

you are right, its not that difficult to match the z-depth in the post, but
the idea was to make it a little bit more comfortable, just load the depth
channels in your compositing software and that´s it. wink


>I tried to render a spherical B2cam to see if the blended
>z-depth would hold negative numbers behind the camera, but I
>couldn't seem to render anything past 180 degrees. Is that
>expected?

Blended z-depth is the distance from the flat image plane in front of the cam, so I
think you have to use the "blended camera distance" option, to get correct
depth in all directions with spherical or fisheye cams.

Tom

Perhaps Krakatoa should

just output the values in

the>negative? Again, this

is something pretty easy to

change in>the composite.

Hello Chad,

you are right, its not that

difficult to match the z-depth

in the post, butthe idea was

to make it a little bit more

comfortable, just load the

depthchannels in your

compositing software and

that´s it.



If that’s the goal, then Krakatoa should just output what it does with the sign changed. In my tests, they matched up nearly identically (scanline z-buffer vs krakatoa rendering geometry vertices with blended z-depth) once I did that. I think, though, that that might confuse people since they will see only black in their VFB’s. I know it confuses people using compositing software when they load in the 3ds max z-buffer and only see black.



I tried to render a

spherical B2cam to see if the

blended>z-depth would hold

negative numbers behind the

camera, but I>couldn’t seem

to render anything past 180

degrees. Is that>expected?

Blended z-depth is the

distance from the

flat image plane in front of

the cam, so Ithink you have to

use the “blended camera

distance” option, to get

correctdepth in all directions

with spherical or fisheye

cams.



I wasn’t getting anything even with regular rendering, not just the blended z-depth. The points just didn’t render if they were behind the camera.


  • Chad

>If that's the goal, then Krakatoa should just output what it
>does with the sign changed. In my tests, they matched up
>nearly identically (scanline z-buffer vs krakatoa rendering
>geometry vertices with blended z-depth) once I did that.

Yes, an option to inverse the direction (near is brighter), would be very useful indeed.

>I wasn't getting anything even with regular rendering, not
>just the blended z-depth. The points just didn't render if
>they were behind the camera.

I can´t test this here, because I´m using finalRender and the cameras of this renderer
are not supportet currently.

Tom