Defocus_Aberrations v1.3
This location is for Registered Users Only.
Perhaps you need to login or register.
13.1, 12.2, 12.1, 12.0, 11.3, 11.2, 11.1, 11.0, 10 or later
Linux, Mac, Windows
Defocus-Aberrations simulates a range of optical aberrations related to lenses and defocus.
This started as a chat message from another comp supervisor I work with. He had a shot he was working on that was heavily defocused and had cat's eye and cropped bokeh visible. He asked if there was a good Nuke tool to handle this and I wasn’t aware of any so built a really simple one to help that shot. Defocus_Abberations grew out of that and I added a number of additional effects along the way.
This is my first contribution to Nukepedia. It’s not as fast as I would like and in some circumstances can have visible artifacts, but I think it might be useful to others.
Here’s a list of the supported features
Internal bokeh generator with noise and onion rings (or external input)
ZDefocus - Nuke’s math or lens based optical defocus (thanks Jedediah Smith
Preprocessor with gamma and highlight boost
Cat’s eye bokeh (circular vignetting)
Astigmatism (radial and tangential stretching)
Cropped bokeh (matte box flagging)
Bokeh color fringing (axial chromatic aberration)
Field curvature effect (causes corner or center blurring)
Lateral chromatic aberration (corner color smearing
Coma
Two styles of vignetting (natural cos^4 falloff and image circle)
To handle effects requiring localized processing for different regions of the screen, the image is divided up into an array of segments and then merged back together after processing. You can determine the size of the array, but rebuilding and processing slows with larger grids.
ChangeLog:
1.0 - Initial release
1.1 - Modified initial reformat of image input to preserve bounding box outside image area for improved edge handling
1.2 - Swapped shuffles nodes to v11 compatible versions (Thanks to Nikolai Wüstemann)
1.3 - Changed some node naming to avoid render farm errors (Thanks to Gregor Stephani)
CAT'S EYE BOKEH - with green-magenta axial chromatic aberration:
ASTIGMATISM:
CROPPED BOKEH - with red-blue axial chromatic aberration:
FIELD CURVATURE - with vignettes and green-magenta lateral chromatic aberration:
ZDEFOCUS SUPPORT:
Comments
https://wuestemann.net/nuke/Defocus_Aberrations_1.1_updated.nk
I have to 2nd Nikolai here, this is insane. Never have I ever seen any gizmo so great in replicating actual lens artifacts instead of random abberations. I fiddled just a few mins and could already replicate some troubled anamorphic footage: https://i.imgur.com/JJSxK5g.jpeg
If you allow some (hopefully constructive) feedback: having a preview of the anamorphic squeeze in the base kernel-view would be really helpful in some cases (like when you can't get a good bokeh-sample from the footage and you want to match it side by side)
Best,
Lucas
Nikolai, I did realize after sharing it with someone at work that I used the new shuffle node, so it's Nuke 12+. I'm just accustomed to using that node at this point, but it's' a bummer that that cuts out people with older versions.
Lucas, I choose to keep the "Base Kernel" as the raw circular iris shape and to have the "Kernel Array" with the bokeh mods applied so you could see how things are affected across the screen. You could rebuild the array with a lower cell count if you need to see the anamorphic kernel larger. It wouldn't be a big deal to modify it, but I'm not able to do that right now.
Thanks Again... Brian
totally understand it :) just thought it could be a conveniant upgrade if you ever decide to make an updated version. Super stoked about it already, this tool would've saved me some serious time in lots of productions :)
Best,
Lucas
Anything I can do with this? Or are there any updates to come?
I wasn't really able to replicate the issue you're having. I tried the 1.2 version of the tool with a 3D render and it worked for me with the bokeh mods on. I believe there is a bug where it's not correctly shuffling depth that's not in the depth.Z channel coming into the node, so I'd try shuffling depth in there if it's in a different chan. Also, make sure you've checked the "Use zDefocus" checkbox on the Master tab to enable zDefocus otherwise none of the zDefocus stuff works. Let me know if you continue to have issues.
I have indeed been using "Use zDefocus" and turned the Defocus Max up a bit in order to see some of the mods do their work. I also found that the "optical 1/z flipped occlusion" math channel works best for me. I've had to switch the depth channel to "viewlayer_dept h.z" in order to get any defocus happening at all.
After all of this I end up with just a fully blurred screen, and grapping the Z value just doesn't work. the value does change, but nothing happenes on screen. That is until I deactivate any of the mods, then I get the DoF I'm looking for. But still no cat's eye
You should take a look at the values in the incoming depth.Z channel and try using the same data fed into ZDefocus or OpticalZDefocus if you're using that approach. I'm just passing the depth into an array of ZDefocus nodes, so it shouldn't behave any differently if the data is correct. Most of my testing has been with the optical defocus approach, since that's the way I think. Have you tried using Nuke's stock ZDefocus and found it works as you'd expect and this behaves differently? Where is your depth data coming from.. scanline render? VRay? I'd suggest avoiding any normalized depth data from a 3D renderer. That doesn't really have any real-world relationship to depth.
I think that's related to some flakiness that Nuke has when you try to expression link input channel selection knobs between nodes. I don't have a full license of Nuke right now to do any more dev work on this. I may try to get a license and do some updates at some point, but I'm pretty busy on a project right now.
Just one teeny-tiny thing I found: It was crashing render nodes occasionally, because of the dashes in the temp-defocus nodes names being illegal characters.
Not sure if this is the case for everyone or has something to do with our configuration here.
If someone has an idea please let me know.
I've renamed them using underscore instead of dashes and the errors were gone.
Thanks again!
Thanks. I guess I wasn't thinking that dashes in the names would cause issues. I don't have a full license right now of Nuke to make changes. If you are able to make changes that would make it more stable and want to send it over, I'd be happy to post an update for everyone.
Because a lot of the effects are designed to simulate how a lens works within the frame, I'm not really accommodating much overscan in the setup so things fall off correctly. If you need a bit more overscan, you could reformat and add 10% or whatever works prior to the effect and then reformat after applying defocus_aberrat ions. I generally would suggest applying the gizmo far down on your node tree when I'd think you'd need less overscan.
My current technique is to cut the node into a separate temp project while I’m working and then paste it back in when i need to render but this is a bit tedious.
RSS feed for comments to this post