Jump to content


Photo

Depth Defocus Macro

Macros Defocus DOF Gringo

  • Please log in to reply
60 replies to this topic

#1 Gringo

Gringo

    Associate Administrator

  • Adv Members
  • PipPipPipPipPip
  • 1,455 posts

Posted 21 May 2008 - 12:58 PM

the macro:
Attached File  DepthDefocus_v01_1.setting   7.81KB   278 downloads

an example of using:
Attached File  Depth_Blur_Macro_v01_1_Example.comp   38.02KB   280 downloads

preview:
Attached File  Depth_Blur_Macro_v01_1.jpg   92.6KB   364 downloads

demo movie: http://www.compositi...Macro_v01-1.mov

#2 Gringo

Gringo

    Associate Administrator

  • Adv Members
  • PipPipPipPipPip
  • 1,455 posts

Posted 21 May 2008 - 01:01 PM

By the way, I found out that the VariBlur itself has the following hidden parameters:
Focal Point
Depth Of Field
Z Scale
They don't appear even if I create a macro using them.

#3 ShadowMaker SdR

ShadowMaker SdR

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 674 posts

Posted 21 May 2008 - 01:53 PM

Hi Gregory, once again that looks impressive. Great job.
I'd love to see it on a more real world exampe though.

#4 Gringo

Gringo

    Associate Administrator

  • Adv Members
  • PipPipPipPipPip
  • 1,455 posts

Posted 21 May 2008 - 03:35 PM

The example I used is the most explanatory.
It shows how the power of defocus increases with distance and how it handles highlights.

You can try it on your own footages/3D renders...
Any feedback is appreciated.

Now I'm trying to solve the transparent background problem.
The complexity is that the VariBlur needs the area filled with defocused object to be filled with a constant color in the depth channel.
Erode/Dilate partially solves that but sometimes produces bad result on overlapping objects at different distance.

#5 Gringo

Gringo

    Associate Administrator

  • Adv Members
  • PipPipPipPipPip
  • 1,455 posts

Posted 24 May 2008 - 04:42 AM

The complete description of the macro: http://vfxpedia.com/...cus_Description

#6 Gringo

Gringo

    Associate Administrator

  • Adv Members
  • PipPipPipPipPip
  • 1,455 posts

Posted 29 May 2008 - 09:43 AM

A new version of the macro.

Some cosmetic improvements and an option to display the defocus power map.

Attached Files



#7 leif3d

leif3d

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 554 posts

Posted 30 May 2008 - 07:06 PM

A new version of the macro.

Some cosmetic improvements and an option to display the defocus power map.




Wow, this is great. It'll come in handy for sure. :)

#8 Gringo

Gringo

    Associate Administrator

  • Adv Members
  • PipPipPipPipPip
  • 1,455 posts

Posted 31 May 2008 - 05:38 AM

A new version of the macro: Attached File  DepthDefocus_v03.setting   11.34KB   187 downloads
Now it can connect (by default) Z Buffer to the output image.

Depth Picker now is more intuitive. It can take depth values right from the resulting image.

The Depth Power Curvature and FG Power parameters now are controlled by sliders instead of screw controls.
It helps to see the correct range of values.

Depth Power Curvature now is defined in different scale. It exactly relates to the power that defocus size is raised to.
If Depth Power Curvature = 1, defocus size increases linearly with depth
If Depth Power Curvature = 0.5, defocus size increases faster with depth
If Depth Power Curvature = 2, defocus size increases slower with depth

FG Power now has more influence on the defocus size.
If FG Power = 1, foreground objects are defocused exactly like background objects (if Depth Power Curvature = 1)
If FG Power = 0, foreground objects are not defocused. Defocus is applied only to the objects that are behind the focal point

Default parameters values were adapted for normalized depth map.

#9 leif3d

leif3d

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 554 posts

Posted 06 July 2008 - 07:21 PM

I just wanted to say that I tried a bunch of filters and plugins for a bad bokeh effect and this plugin saved me from spending money on Lenscare or Awake... :D

I mean, yeah...it doesn't have the set of features of those two, but for free?! and fast!

The only wish I have, is to be able to isolate the bokeh effect a little better.

This beats the defocus tool (lens) by far, specially in speed.

Oh, I almost forgot...pluging in a Z channel doesn't work, but luma works wonders.


Thanks again!

#10 Gringo

Gringo

    Associate Administrator

  • Adv Members
  • PipPipPipPipPip
  • 1,455 posts

Posted 07 July 2008 - 03:05 PM

Nice to hear my macro is so useful :)

I've double checked the Z channel usage and it works for me, see the example:
Attached File  Depth_Defocus_Macro_v03_Example_CubesZ.jpg   29.06KB   200 downloads
http://www.compositi...pthDefocusZ.rar

About bokeh isolation, now I apply the Erode/Dilate and Blur to the depth map before the macro, like in the example.

But I'd like to find a method to extend Z of foreground objects in a better way:
Attached File  Z_Extention_Original.jpg   8.43KB   211 downloadsAttached File  Z_Extention_ED.jpg   7.4KB   223 downloadsAttached File  Z_Extention_Needed.jpg   7.69KB   215 downloads
Anyone knows how to solve it?

#11 leif3d

leif3d

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 554 posts

Posted 08 July 2008 - 01:07 PM

This is weird...

your comp works fine, but when I try to convert a luma channel to Z through a channel boolean the macro wont work...

#12 Gringo

Gringo

    Associate Administrator

  • Adv Members
  • PipPipPipPipPip
  • 1,455 posts

Posted 08 July 2008 - 01:23 PM

Can you give me an example of the depth map in luma that the macro doesn't work with?

#13 marvin

marvin

    Member Pig

  • Adv Members
  • PipPip
  • 24 posts

Posted 14 July 2008 - 04:17 AM

Very nice, thank you! Also for your other macros.. some good stuff there! :)

#14 robertjackson1

robertjackson1

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 128 posts

Posted 14 July 2008 - 11:47 AM

very nice as always Gringo, thank you. The working example is so useful.

#15 jonangelo

jonangelo

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 54 posts

Posted 02 September 2008 - 04:19 AM

Nice, really nice. Thanx Gringo

/JonAngelo





Also tagged with one or more of these keywords: Macros, Defocus, DOF, Gringo

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users