{"id":313,"date":"2015-02-13T12:18:49","date_gmt":"2015-02-13T17:18:49","guid":{"rendered":"http:\/\/www.tks-designs.com\/blog\/?p=313"},"modified":"2015-02-13T12:19:48","modified_gmt":"2015-02-13T17:19:48","slug":"nuke-ramped-defocus","status":"publish","type":"post","link":"https:\/\/www.tks-designs.com\/blog\/?p=313","title":{"rendered":"Nuke Ramped Defocus"},"content":{"rendered":"<p>If I have an image in nuke that I want to control the falloff of the depth of field, ordinarily I would pump a ramp into the mask input of defocus. However, this would only work if I want my defocus to start at 0 and move to some value. If, however, I want the smallest amount of defocus to be something other than 0, say 2, I can&#8217;t achieve this effect with a good result, even if I adjust the start value of my mask input (instead of ramping from 0-1, say .2-1). If I input this ramp into the mask input on a defocus, this is the result:<\/p>\n<p><a href=\"http:\/\/www.tks-designs.com\/blog\/wp-content\/uploads\/2015\/02\/maskedDefocus1.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.tks-designs.com\/blog\/wp-content\/uploads\/2015\/02\/maskedDefocus1.jpg\" alt=\"maskedDefocus\" width=\"580\" height=\"561\" class=\"alignleft size-large wp-image-319\" srcset=\"https:\/\/www.tks-designs.com\/blog\/wp-content\/uploads\/2015\/02\/maskedDefocus1.jpg 878w, https:\/\/www.tks-designs.com\/blog\/wp-content\/uploads\/2015\/02\/maskedDefocus1-300x290.jpg 300w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>Instead of moving from a 2 defocus to a 10 defocus, instead I get the original un-blurred result, with the 10 defocus merged on top of it at 20%, creating a halo.<\/p>\n<p>With a few merges and two defocuses instead, I can get a much better result:<\/p>\n<p><a href=\"http:\/\/www.tks-designs.com\/blog\/wp-content\/uploads\/2015\/02\/rampedDefocus1.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.tks-designs.com\/blog\/wp-content\/uploads\/2015\/02\/rampedDefocus1.jpg\" alt=\"rampedDefocus\" width=\"878\" height=\"850\" class=\"alignleft size-full wp-image-320\" srcset=\"https:\/\/www.tks-designs.com\/blog\/wp-content\/uploads\/2015\/02\/rampedDefocus1.jpg 878w, https:\/\/www.tks-designs.com\/blog\/wp-content\/uploads\/2015\/02\/rampedDefocus1-300x290.jpg 300w\" sizes=\"auto, (max-width: 878px) 100vw, 878px\" \/><\/a><\/p>\n<p>So I grouped this little setup and posted it here. Simply add a gradient map into the ramp input, 0-1, and set your minimum blur and maximum blur values, and you&#8217;ll get a much smoother result.<\/p>\n<pre><h2>Download:<\/h2><code><a href=\"http:\/\/www.tks-designs.com\/blog\/wp-content\/uploads\/2015\/02\/rampedDefocus.txt\">rampedDefocus<\/a><br \/>\r\ntested on Nuke 9.0v4<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>If I have an image in nuke that I want to control the falloff of the depth of field, ordinarily I would pump a ramp into the mask input of defocus. However, this would only work if I want my defocus to start at 0 and move to some value. If, however, I want the <span class=\"ellipsis\">&hellip;<\/span> <span class=\"more-link-wrap\"><a href=\"https:\/\/www.tks-designs.com\/blog\/?p=313\" class=\"more-link\"><span>Continue Reading &rarr;<\/span><\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"kia_subtitle":"A quick group for better defocus","footnotes":""},"categories":[18,3,10],"tags":[],"class_list":["post-313","post","type-post","status-publish","format-standard","hentry","category-gizmo","category-nuke","category-vfx"],"_links":{"self":[{"href":"https:\/\/www.tks-designs.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/313","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tks-designs.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tks-designs.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tks-designs.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tks-designs.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=313"}],"version-history":[{"count":4,"href":"https:\/\/www.tks-designs.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/313\/revisions"}],"predecessor-version":[{"id":322,"href":"https:\/\/www.tks-designs.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/313\/revisions\/322"}],"wp:attachment":[{"href":"https:\/\/www.tks-designs.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tks-designs.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tks-designs.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}