PDA

View Full Version : Nuke Zblur?



hugo_guerra
June 16th, 2007, 03:44 PM
Hi, i have been have some problems with Nuke´s Zblur.

I Always make a grade with the values of the zdepth (overing with mouse over Depth to have "-" values) to have a Zchannel

Then I use Zblur to simulate a real lens blur, but I always get a strange glow around the edges in the most focused part of my render.

I am using Max EXR with Z, Normals and Velocity passes from the Scanline render.

Also is there any kind of way to make a real Defocus with some lens hexagonal effect, just like the Lens Care effect in After effects from the frischluft Plugin?

My last question is, what kind of zdepth should I have? White in backgound and black in foreground or the oposite of that?

Anyway had also problems with this?

Thanks

rueter
June 17th, 2007, 12:39 AM
>>Also is there any kind of way to make a real Defocus with some lens hexagonal effect

I believe the Defocus node only uses disks for lens artifacts but you can gain more control over this by using the Convolve Filter. It will allow you to use a second input as the shape of the artifact so you have full control over it.

>>My last question is, what kind of zdepth should I have? White in backgound and black in foreground or the oposite of that?

Depending on where your z channel comes from (Maya, 3dsMax, PRMan, self made, etc) and how the near and far values coretae to each other you will have to adjust the "math" knob in the ZBlur node accordingly. I.e. if you normalize your z channel (which you may have implied with your first sentence) to give far values the value of '1' and near ones the value of '0' than set the "math" knob to "far=1".
Check the "focal-plane setup" to make life easier when setting up the dof.

I found that sometimes the "distance" value for the math knob behaves strangely but when I then normalized the values manually with a grade node and used the "far=1" setting it worked fine.

hope this helps.

cheers,
frank

Diogo Girondi
June 17th, 2007, 02:46 AM
I believe the Defocus node only uses disks for lens artifacts but you can gain more control over this by using the Convolve Filter. It will allow you to use a second input as the shape of the artifact so you have full control over it.

Just to add something to what Frank said keep in mind that the convolve filter is really processor intensive so try to keep you shape on the secondary input as small as you can. Also if you are using it to "defocus" something with an alpha channel make sure that your shape in the secondary input is present on the alpha as well.

hugo_guerra
June 22nd, 2007, 12:52 PM
I still get a very strange blurred edge with the Zblur node, should I try blurring the Zdepth? I tried with the normal blur node but with little results.

Anyone has a better node, or technic to antilising the Z pass.


All of best

lewis
June 22nd, 2007, 01:57 PM
If you have really abrupt changes in your depth, like a single sharp foreground object over a distant background, doing the blurring in a single node doesn't work very well. It's better to split your image into near and far plates, blur them individually and comp them back together if you can. You tend to get glows around close objects, maybe that's what you're seeing?

It's the same in Shake or anything else.

sl0throp
June 29th, 2007, 01:43 PM
Z passes are not usually edge aliased at all especially if you are outputting from a render pass or framebuffer rather than a a z shader or a fake Z pass from a projection ramp or something or other. I have seen people get around this problem by blurring z passes, choking there alpha where possible and rendering out Z data at twice resolutionTruthfully I often fake my Z using a projection ramp set to my desired clip values output this via mental ray with ctrl_buffers so there is no real render hit. Also make sure that you are outputting Z data at a minimum of 16 bit.

s

Chim
July 10th, 2007, 11:09 AM
When it comes to the zblur im personaly always have some problems on semitransparent or motion blured objects. We always used to fake optical defocus effect somehow but rarely rely on zblur. For example i will attach pic from my latest comp where we wanted to use zblur but switched to prerendered depth of field effect.

Maybe im doing something wrong please let me know how can i solve this situation.
IM using zblur node with math turned to far=0 (my depth is far=0 near=1) Depth is antialiased pass and thats is the main problem imo. Because nuke dont know if this is antialiased/motionblured edge or this is object in depth so it produce strange results in motionblured areas or on object edges.

lewis
July 10th, 2007, 02:51 PM
I don't think you're doing anything wrong, that's just a tricky scene to use 2D depth of field post-processing on. Those sharp changes in depth and the motion blur make it really hard.

Zblur flat out cannot work properly for motion blurred edges, soft edges and transparent objects... the information just isn't there for Nuke (or anything else, as far as I know) to work out what should be blurred and what shouldn't. You'll have to either use true 3D DoF, or split your render into several depth slices and work on them seperately, probably with 2D motion blur in post to avoid having to ZBlur soft edges again...

You should be able to help the foreground glow by multiplying by the matte after you defocus but otherwise I'd do a shot like that in 3D.

agentex
July 11th, 2007, 02:41 PM
In addition to those good points I always grade my Zpasses with a Lookup, if I'm slicing or working with them it helps me to roll things off so I can avoid bad edging.

NEO
September 12th, 2007, 08:26 AM
What would zdepth from maya normaly be in? -depth? Don't really get the hang of this.

Edit... I might be stoopid but the help on focal plane set up says;

red: less then DOF
green: inside DOF
blue: greater then DOF

Then the question is how they define less and greater. Would something greater then DOF be in the distance "behind" the DOF? And something less then DOF be closer to the cam?

NEO
September 12th, 2007, 09:03 AM
Mkay... Migh have got the hang of it. It should probably -depth on Maya standard IFFs. And I also had to put in an erode node since the Z didn't match up perfect against the color-pass.

rueter
September 12th, 2007, 10:13 AM
>>Then the question is how they define less and greater. Would something greater then DOF
>>be in the distance "behind" the DOF? And something less then DOF be closer to the cam?
yes, "less" should be the area between the camera and the depth valu set with the focus plane knob, blue should be the area between focus plane and infinity

If you're not sure about which mode to use, sometimes it's easiest to just manually normalize the z channel (use a grade node and set your black and white points to the near and far values respectively), then use "far=1". I like doing that sort of thing as I can apply a gamma to the z channel and therefore control the falloff of my ZBlur.

NEO
September 12th, 2007, 10:22 AM
Aaah... That's actually a great idea. Thanks rueter.