Author Topic: Postproduction (fake) DOF via ZDepth  (Read 9258 times)

2016-10-20, 18:52:33

Jpjapers

  • Active Users
  • **
  • Posts: 1654
    • View Profile
Now we have such great tools in the VFB it would be great to also be able to adjust the DOF in the vfb if youve rendered a zdepth pass!
« Last Edit: 2017-03-11, 13:30:14 by Ondra »

2016-10-20, 19:41:27
Reply #1

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12758
  • Marcin
    • View Profile
I don't think this is a good idea.
1. True dof renders fast enough for previews.
2. Fake zdepth dof looks too bad for anything else than previews (see point 1).
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2016-10-21, 15:13:31
Reply #2

Jpjapers

  • Active Users
  • **
  • Posts: 1654
    • View Profile
Fair enough

2016-10-21, 15:37:36
Reply #3

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12758
  • Marcin
    • View Profile
On the other hand, let's hear others' opinions. I know that this is widely requested feature...
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2016-10-21, 17:32:39
Reply #4

PROH

  • Active Users
  • **
  • Posts: 1219
    • View Profile
Hi. I've never used fake DOF but can easily imagine situation where adjustable DOF would be useful - i.e. in animations. And since it seems reasonable easy to add, then why not? We don't all have same needs :)

2016-10-22, 02:26:59
Reply #5

Jpjapers

  • Active Users
  • **
  • Posts: 1654
    • View Profile
I think it would be a useful feature to have for those of us that dont use cameras and just render from perspective mode when working quickly without the time to set up renders with cameras. I agree that proper DOF does render quickly and really nicely but it would be great to have the option to work with our render passes in the VFB.

2016-10-22, 10:18:38
Reply #6

Njen

  • Active Users
  • **
  • Posts: 557
    • View Profile
    • Cyan Eyed
FYI fake DoF is used ALL the time in VFX. Rarely do small to medium vfx studios waste the rendertime on true DoF.

2016-10-22, 10:31:07
Reply #7

Njen

  • Active Users
  • **
  • Posts: 557
    • View Profile
    • Cyan Eyed
As proof to show that fake DoF is very much alive and kicking is in the following test that I did yesterday, coincidently enough, I am deciding on my DoF workflow for my animated short this week, so this topic is very close to me right now.

The following test has fairly heavy DoF with bright highlights (open up the images in separate tabs for true a comparison). 'dofTest_true.jpg' is true DoF that rendered in 25 minutes and still has visible noise. 'dofTest_fake.jpg was rendered with no DoF in 23 minutes then fake DoF in Nuke was added using the ZDepth pass that I also rendered: a very nice result with beautiful circles of confusion.

2016-10-22, 13:25:40
Reply #8

Juraj

  • Active Users
  • **
  • Posts: 4761
    • View Profile
    • studio website
Yup, that is pretty much render-time DOF :- )

(And no, setting GI:AA to 1 and waiting billion years will not help, this is what it is).

For very subtle DOF (f-stop 4-8 for 24mm camera), I use render-time, it's much more natural, pleasing. But for "heavy", artistic type DOF, I would 100perc. go with post-production. Not only for flexibility but because it does look nicer without all the artifacts of noise and speckles.
Please follow my new Instagram for latest projects, tips&tricks, short video tutorials and free models
Behance  Probably best updated portfolio of my work
lysfaere.com Please check the new stuff!

2016-10-22, 17:46:41
Reply #9

Ludvik Koutny

  • VIP
  • Active Users
  • ***
  • Posts: 2557
  • Just another user
    • View Profile
    • My Portfolio
Unfortunately, post-process DoF will almost always fail if there's something in the foreground. Also, in VFX, rendertime DoF is actually being used more and more these days because it's not so expensive to render anymore.

So while it's good to have, the use cases for it vs for rendertime DoF are like 50:50... rendertime DoF being a rare luxury is myth these days.

2016-10-22, 20:08:28
Reply #10

Jpjapers

  • Active Users
  • **
  • Posts: 1654
    • View Profile
Youre right actually Rawalanche. You end up with horrible fringing if theres something in the foreground and transparency doesnt work either.

2016-10-23, 03:28:52
Reply #11

Njen

  • Active Users
  • **
  • Posts: 557
    • View Profile
    • Cyan Eyed
I'm, not sure why you think there is horrible fringing. When used correctly, artifacts are hardly noticeable when studied closely on single images and practically invisible when viewed on the move. Like I said before, Fake DoF is currently used the majority of time in VFX over in-camera DoF because it provides a better result for less computing power even if the trade off is some tiny artifacts here and there.

Plus, Foreground/background issues with fake DoF are even less of an issue when using a good pixel filter, like 'closest to camera', and with Deep rendering slowly becoming more popular, fake DoF is almost indistinguishable from in-camera DoF.

Below is before and after fake DoF is applied on a shot I am working on that has an obvious foreground and background.

[Edit:] Just for perspective, the last 5 projects I have worked on (X-Men: Apocalypse, Game of Thrones, Gods of Egypt, The Wolverine, X-Men: Days of Future Past) we never used in-camera DoF, but plenty of fake DoF.
« Last Edit: 2016-10-23, 04:25:43 by Njen »

2016-10-23, 22:41:29
Reply #12

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 9048
  • Turning coffee to features since 2009
    • View Profile
I am not sure about this - on one hand, fake DOF seems like something that will eventually die out, and produces worse quality than rendered one, on the other hand, a lot of people request this. There might be also the matter of finding the optimal algorithm, which sounds like another kind of black magic on its own.

Another thing is that we have one idea in our heads that could actually speed up DOF rendering A LOT while not being 100% fake (more like being 10% fake). We might try that first, before resorting to the 100% fake approach
Rendering is magic.How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)

2016-10-24, 09:02:04
Reply #13

FrostKiwi

  • Active Users
  • **
  • Posts: 686
    • View Profile
    • YouTube
The way I handled it in the past is a cheaty hybrid approach with Vray. Vray did DoF and MoBlur with low samples in an interesting way, I can't exactly explain. Vray interpolated the Blurry samples with some kind of Blur of it's own. The result was a "not quite" smoothed MoBlur/DoF. In post I would use something like RSMB or LensCare to "add DoF" on top of it to smooth the result out. It worked great in the past.

When used correctly, artifacts are hardly noticeable when studied closely on single images and practically invisible when viewed on the move.
One the one side well executed Deep compositing or the new "Evotis" file format seem to completely solve this, although outside of a renderer. It means necessary tweaks and knowledge of the method used. With Corona's philosophy a one click solution is required. Nuke's Zdefockus comes to mind, awesome for the passionate VFX artist, unusable hell for people in 3D. On the other I kinda wondered, why nobody came up with a hybrid solution to solve the biggest gripe - Zdepth accuracy issues on the focus plane. Focus plane < +/- 10% = Sample, Focusplane > +/- 10% = slap a blur on it. Black magic thinking I suppose.

Also awesome quote I recall from John Carmack at a quakecon keynote "A colleague from the offline renderer crowd came up to me and said "You have whole books about how to shadow map even the simplest things"". Gotta find that one again.
So maybe we should just puke more samples all over the screen and call it a day.
I'm 🐥 not 🥝, pls don't eat me ( ;  ;   )

2016-10-26, 23:14:03
Reply #14

Jpjapers

  • Active Users
  • **
  • Posts: 1654
    • View Profile
I am not sure about this - on one hand, fake DOF seems like something that will eventually die out, and produces worse quality than rendered one, on the other hand, a lot of people request this. There might be also the matter of finding the optimal algorithm, which sounds like another kind of black magic on its own.

Another thing is that we have one idea in our heads that could actually speed up DOF rendering A LOT while not being 100% fake (more like being 10% fake). We might try that first, before resorting to the 100% fake approach

Colour me intrigued :)

2016-10-26, 23:47:16
Reply #15

cecofuli

  • Active Users
  • **
  • Posts: 1577
    • View Profile
    • www.francescolegrenzi.com
In my opinion, the battle is not "3D DOF good but slow" and "Post DOF is fast but bad".
The question is to have the possibility to change it in post!
for example, we create a nice shot with 3D DOF. In preview, low res, low quality your clients say: good, I like it.
But, when you render in 4K, with good quality, they can say... O god.. It's too much, or...  it's too less!
In a lot of shot, DOF 3D can be very fast (no strong highlights, no DOF reflection or reflaction), I agree.
But, in this situation, also  the 2D DOF does a good job, and I can change it easily with ZDepth. =)