very frustrating limitations of the Vray Z depth buffer.

Hi all,

just a quick question to ask about limitations of the Vray Z depth buffer.:rage:

Would it be possible to get the Z depth buffer to recognize a simple black-and-white opacity, so that geometry, such as alpha mapped leaves would work properly with the Z depth buffer.

I understand the complications and limitations of the Z depth buffer when working with semi-transparent objects, but I don’t see why it can’t work [ or be made to work] with pure black and white alphas that clip away alpha -geometry.

I have tried to use a falloff map [with the falloff set to camera distance]. To generate a Z depth buffer [ using it as a extra-tex render element] and it automatically cut out the alpha int the geometry of the leaves. It’s a bit of a workaround that seems to give satisfactory results, but i would rather use the Z-depth.

So is there any way to get Z depth buffer to clip away an alpha channel before working out the depths of the pixel.
Would it have to be rewritten to do such a thing.
It just seems so simple, using the falloff map that I can’t see why the Z depth can’t do the same thing

Forgive me if I am looking at this bit to simplistically.

Cheers:grin:

Hello,
I’ve just tried the VrayZDepth, because I will need it soon with alpha channel support. And it seems to work!? I just create a ptepot with a Vraymtl, I add a checker in the opacity map slot, and everything seems ok.
Did I miss something?

The VRayZDepth works fine for me too. You need to make sure that the ā€œfilteringā€ option is turned ON and that you are using V-Ray 1.5 SP3 or later - just checked with both VRayMtl and a Standard material.

Best regards,
Vlado

Thanks Vlado!

I didn’t have the 'Enable Filtering option enabled & it seems to be cutting out the alpha geometry fine, now that I have turned it on.

The only problem is that now the Z-depth is anti-aliased which is not really of any use now as it won’t work properly for DOF in post.
[This is the reason I had the filtering ā€˜OFF’ in the first place as antialiasing creates’ false’ distances on edges..creating artifacts when trying to do DOF in post.

Is there any way to get it to filter the alpha without anti-aliasing the edges???

Could it be done with the SDK???

Thanks again for all your help

So I think I have finally worked it out…thanks for the help.

The two main issues I noticed are below

1.
To get the Zdepth to NOT antialias the edges you need to set the Image Sampler to fixed at value 1. This will keep the pixels at the correct depth
This obviously requires a separate pass as the main render usually uses Adaptive DMC sampler.
Iit’s quick to create another Z-depth pass anyway, so it’s not an issue.

2.
The alpha map has to be pure Black & white [If you are trying to clip geometry ]

And now I can finally do some DOF in post… to my hearts content

Cheers

Interesting.
Vlado, I assume it’s not possible to have the z-depth rendered using fixed sampling to achieve the correct alpha without aliasing ? It would be nice to avoid having to setup a seperate pass.

You can certainly use fixed sampling, but that would be for the entire image; it is not possible to have different sampling just for one of the elements.

It might be possible to make the alpha transparency work with filtering turned off, but I have to look into it.

Best regards,
Vlado

Please look into this! Being able to automatically render an non-antialiased z-depth is absolutely essential if you plan on using any post DOF. By the way - is there any way to extract the Z-depth separately without having to re-render the entire image?

T

Hi there,

I just thought i had to bring this thread up again since i am experimenting alot with zdepth lately.

Will it be possible to render zdepth with turned of filtering without having strange alpha issues in the future?

Best regards

Bjƶrn

Bump :slight_smile:

Anything on this?

No, there is nothing new here yet unfortunately. This is still on the ā€œto doā€ list, but we have to complete some other things before that.

Best regards,
Vlado

Hi Vlado,

So where are we at with getting opacity maps generating correct render elements for zdepth, velocity and normals?

Ali

Will be done for the nightly builds on Monday…

Best regards,
Vlado

So this is fixed for the next nightly tomorrow; if you can test and let me know if it works as expected, it will be very helpful.

Best regards,
Vlado

IS this for version 2.4 or for 3? If it is for 2.4 can you tell me how to access it, as I would really like to get this to work for me. thanx. --ds

It was done for both nightly build versions. Please email us to vraymaya@chaosgroup.com for nightly builds access.

Best regards,
Vlado

If I need to do this I just turn off all lights, maps, reflections etc in global and re-render. You don’t need any of these to render the zdepth.

Hi, I’m using this build and it’s working great as far as the aliasing is concerned. But now I have another problem, and it may be something I’m just not setting right, but I’ve tried everything I can think of. There’s no way I can adjust any of the VRayZDepth parameters so that objects closer will be lighter grey, objects farther will be darker grey, and the background will be black that’s the critical thing. If I adjust it to give me correct shades for the objects I always get a white background, and if I set it to get a black background, then the object values are always reversed. What am I doing wrong here? Of course the workaround is to put a plane way deep in the background, but that’s probably not always optimal.

thanx --ds

It’s a bug that I need to fix (seems to have come up when I fixed the transparent stuff). In the meantime, you can just put a plane that is sufficiently far away, as you suggested.

Best regards,
Vlado