Greetings!

Welcome to Scifi-Meshes.com! Click one of these buttons to join in on the fun.

Z-Depth + DOF Issue...

Chris2005Chris2005675 Posts: 3,096Member

Video says it all...
Post edited by Chris2005 on
AMD Ryzen 9 5900X
Gigabyte RTX 3080 Gaming OC 12GB
1TB NVMe SSD, 2 x 1GB SATA SSD, 4TB external HDD
32 GB RAM
Windows 11 Pro

Posts

  • IRMLIRML253 Posts: 1,993Member
    what's the issue? you just want to know why it does this? or you want to be able to blur the back of the nacelles?

    as a side issue, you shouldn't be using lens blur at all, this is a 300m ship, lens blur will just make it look like a model, unless you really want it to look like a 1960s TV effect I would leave the lens blur off altogether
  • MelakMelak332 Posts: 0Member
    I think the issue is that the blur does not blur surrounding pixels when there is a large difference in the z-depth luminosity there:
    lensblur.png
    it mostly blurs inside the boundaries of the object, as described by the zdepth. You can see it blurring a little across where it the neighbouring pixels have a zdepth > 0, i.e. where the teapots overlap.
  • IRMLIRML253 Posts: 1,993Member
    not quite

    post process lens blur plugins don't know what separate objects are, all they get from the depth buffer is how much to blur a given pixel, but if you do a blur only based on depth then sharp and blurry areas would bleed into each other

    what it has to do to make the blur work correctly is know when a pixel is in front of another, so for example a focused foreground pixel doesn't get covered by a blurry pixel in the background

    what is happening is simply your depth buffer is backwards to what the plugin expects, your background should be white and your foreground should be black, so essentially it's treating the saucer and the green backdrop as if they're in front of the nacelles

    when you click on invert you are just inverting the depth buffer so it now thinks things are the right way around, just set your focus to be 100% instead of 0% and it will go back to blurring the nacelles again, but correctly this time

    in the image melak posted above the depth buffer is also backwards, so his results have errors, particularly noticable around the spouts
  • MelakMelak332 Posts: 0Member
    That's the thing though. I've already tried inverting the zdepth either in AE or beforehand, and using the opposite focus distance, it doesn't make a difference:

    invzdepth.png
  • IRMLIRML253 Posts: 1,993Member
    try ticking the invert button in the plugin instead, though if what you say is right you'll probably get the same results, it could instead be an alpha problem (assuming you have an alpha channel)

    tbh I don't use the AE lens blur because I've found it's pretty shizer in the past, maybe I even ran into this problem myself
  • MelakMelak332 Posts: 0Member
    Same results with in-AE inverting.

    Alpha or not, not difference.

    what kind of blur do you use?
  • Chris2005Chris2005675 Posts: 3,096Member
    IRML wrote: »
    what's the issue? you just want to know why it does this? or you want to be able to blur the back of the nacelles?

    as a side issue, you shouldn't be using lens blur at all, this is a 300m ship, lens blur will just make it look like a model, unless you really want it to look like a 1960s TV effect I would leave the lens blur off altogether

    Exactly what you've pointed out... and I've tried all the same steps as Melak, and I can't get it to work...

    Yea, I'm wanting to go with the 60s look...
    AMD Ryzen 9 5900X
    Gigabyte RTX 3080 Gaming OC 12GB
    1TB NVMe SSD, 2 x 1GB SATA SSD, 4TB external HDD
    32 GB RAM
    Windows 11 Pro
  • IRMLIRML253 Posts: 1,993Member
    post that frame of the render and corresponding depth buffer here and I'll have a look myself, but I have a feeling it's probably just a poor plugin
  • Chris2005Chris2005675 Posts: 3,096Member
    IRML wrote: »
    post that frame of the render and corresponding depth buffer here and I'll have a look myself, but I have a feeling it's probably just a poor plugin

    frame0000.png

    frame_fRZDepth0000.png
    AMD Ryzen 9 5900X
    Gigabyte RTX 3080 Gaming OC 12GB
    1TB NVMe SSD, 2 x 1GB SATA SSD, 4TB external HDD
    32 GB RAM
    Windows 11 Pro
  • Chris2005Chris2005675 Posts: 3,096Member
    Someone over on VCP Forums, said to "Use an adjustment layer to apply the lens blur, and discard the alpha for the z depth pass. And that's it."

    However, I think I did it right, and got the same results...
    AMD Ryzen 9 5900X
    Gigabyte RTX 3080 Gaming OC 12GB
    1TB NVMe SSD, 2 x 1GB SATA SSD, 4TB external HDD
    32 GB RAM
    Windows 11 Pro
  • IRMLIRML253 Posts: 1,993Member
    yeah I can't get it to work, the AE plugin seems to be suited only for sharp foregrounds and blurry backgrounds, not blurry foregrounds and sharp backgrounds

    also your depth buffer is antialiased, which will create errors even with a good plugin
  • Chris2005Chris2005675 Posts: 3,096Member
    IRML wrote: »
    yeah I can't get it to work, the AE plugin seems to be suited only for sharp foregrounds and blurry backgrounds, not blurry foregrounds and sharp backgrounds

    also your depth buffer is antialiased, which will create errors even with a good plugin

    So, the Lens Blur doesn't work at least the way I need it to... are there any plugins specifically geared towards this... I want to avoid using DOF within Max, as it'll take a killer long time to do...

    Yea, I can easily re-render the pass without AA...
    AMD Ryzen 9 5900X
    Gigabyte RTX 3080 Gaming OC 12GB
    1TB NVMe SSD, 2 x 1GB SATA SSD, 4TB external HDD
    32 GB RAM
    Windows 11 Pro
  • L2KL2K0 Posts: 0Member
    you can do 2 precomp with your z pass, where white is the focal point. just play with curves and levels.
    one precomp back ground, one foreground.
    then in the principal comp, put 2 lens blur with the 2 Z precomps.
  • japetusjapetus2937 SeattlePosts: 1,397Member
    Post Zdepth can definitely be tricky, but as IRML said, I wouldn't use it either, this is a huge ship and in real life there would be pratically no visible depth of field on this. You'd get a lot more bang for your buck with a velocity bass instead which would cause 99.999% of the blurring in that shot.

    but in answer to what you posted, it looks like you need to unfilter your zdepth pass, which means uncheck the filter box in the zdepth pass in max, that will help the blending.
Sign In or Register to comment.