Defocus_Aberrations v1.3


 
This location is for Registered Users Only.
Perhaps you need to login or register.
Contributor: Brian Sales
Defocus and lens aberration tool that simulates a variety of optical effects
Requirements:
13.1, 12.2, 12.1, 12.0, 11.3, 11.2, 11.1, 11.0, 10 or later
Linux, Mac, Windows
14 Aug 2022
1420

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:

CatsEye

 

ASTIGMATISM:

Astigmatism

 

CROPPED BOKEH - with red-blue axial chromatic aberration:

CroppedBokeh

 

FIELD CURVATURE - with vignettes and green-magenta lateral chromatic aberration:

FieldCurve


ZDEFOCUS SUPPORT:

ZDefocus.jpg

 

 

Please login in order to download these files.

Comments   

 
+1 # Nikolai Wüstemann 2021-03-25 15:41
This is wild, nice job. It might be the biggest gizmo on this website :D
 
 
0 # Nikolai Wüstemann 2021-04-02 19:36
UPDATED the gizmo for Nuke Versions < 12.x with the old shuffle node:

https://wuestemann.net/nuke/Defocus_Aberrations_1.1_updated.nk
 
 
0 # Eidy Knowles 2021-04-06 14:47
Hi Nikolai, I tried to open this link to get the updated gizmo but the link has expired. Do you have another link by any chance? It would be amazing to try this out
 
 
0 # Eidy Knowles 2021-04-06 14:48
EDIT: accidental double post
 
 
0 # Nikolai Wüstemann 2021-04-06 20:19
Thnaks for noticing, I updated the link above to something permanent!
 
 
0 # Eidy Knowles 2021-04-06 20:46
Thank you so much Nikolai it's working now! This tool is amazing Brian!
 
 
+1 # Brian Sales 2021-04-07 02:03
Nikolai, unless you object, I'm gonna test your version out and release it as a new update? Thanks for working on this.
 
 
0 # Nikolai Wüstemann 2021-04-07 06:39
Definetly! Let's open this up for studios with older Nuke versions :)
 
 
0 # Lucas Pfaff 2021-03-29 19:33
Hey man,

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
 
 
0 # Nikolai Wüstemann 2021-03-31 07:13
Important note: You are using the new shuffle node inside the group, which makes the tool break for Nuke Versions 11.x or lower! I would definitely replace them with the good old Shuffle ;)
 
 
+1 # Brian Sales 2021-03-31 07:39
Thanks for your feedback and support on this. I'm glad people are finding it useful.

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
 
 
0 # Lucas Pfaff 2021-03-31 18:32
Hi 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
 
 
0 # Daniel Buck 2021-03-31 17:49
This is quite good! Thanks for sharing it!
 
 
0 # Adrian Krokå 2022-04-03 22:12
I'm noticing that when using any of the bokeh mods such as the "Cat's Eye", Selecting a focal piont stops working. I was able to get the focal point working after a lot of tweaking but I sadly can't use any bokeh mods with it. only a fully blurred image.
Anything I can do with this? Or are there any updates to come?
 
 
0 # Brian Sales 2022-04-05 08:21
Adrian,
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.
 
 
0 # Adrian Krokå 2022-04-05 09:45
Hey Brian, thanks for your hasty reponse!
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 :sad:
 
 
0 # Brian Sales 2022-04-06 06:36
Adrian,
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.
 
 
-1 # amit mahata 2022-05-27 05:39
Hey Brian, its awesome gizmo . But sometimes getting some error 'nothing is named "parent.unpremu lt_z". '
 
 
0 # Brian Sales 2022-05-27 06:52
Thanks Amit.
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.
 
 
0 # Gregor Stephani 2022-07-20 11:17
Very cool Gizmo, thanks a lot!
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!
 
 
0 # Brian Sales 2022-07-21 06:30
Gregor,

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.
 
 
+1 # Gregor Stephani 2022-07-30 18:02
I'll contact you via LinkedIn, so I can send you the thing to update. Thanks!
 

You have no rights to post comments

We have 2757 guests and 82 members online