Author Topic: Blur mask demo  (Read 6383 times)

Offline bigben

  • Member
  • *
  • Posts: 2129
  • The Long Stranger rides again
    • Tinkering with Terragen
Blur mask demo
« on: August 02, 2007, 12:02:58 AM »
Hi All

I made this quick demo for Martin so I thought I'd post it here.  Attached is a TGD I whipped up to set up a blur mask to use with Photoshop's Lens Blur.  The settings shown in the TGD are for rendering the mask, showing what has been disabled (see lighting and atmosphere), and an additional render node added for the mask to save changing settings all the time.

The sky is black in the render so I used the magic wand to select it (and expanded the selection by 1 pixel) and filled it with white. You can see what happpens if you don't do this in the screengrab (note the sharp peak on the horizon to the right). If you're only blurring the foreground you don't need to do this.

The demo combines two masks to blur the foreground and background. You could use either of them on their own.  I haven't tried this on objects yet... should be interesting...
« Last Edit: August 02, 2007, 05:15:24 AM by bigben »

Offline Tangled-Universe

  • Terrevangelist
  • *
  • Posts: 6183
    • CGScenery.com - Terragen Tutorials!
Re: Blur mask demo
« Reply #1 on: August 02, 2007, 08:39:13 AM »
Hi Ben,

Thanks a lot for your quick response to my IM and the clear explanation ;D
It's a lot easier than I thought. I've been looking for far too complex solutions *lol*
Within a few days I'll finish a render and I intend to use this technique, so I'll show you.
Thanks again, also for the .tgd  :)

Martin

Offline cyphyr

  • Member
  • *
  • Posts: 3990
    • richardfraser
Re: Blur mask demo
« Reply #2 on: August 02, 2007, 09:36:07 AM »
Looks very useful. Is the mask you output basically a Grey scale "Z-depth" mask, ie the further away from the camera (or other user defined point) the more white (or black) the mask gets?
Richard
www.richardfraser.co.uk
https://www.facebook.com/RichardFraserVFX/
/|\

i7 5930 @3.5Ghz, 32Gb (TG3 benchmark 6:04)
i7 980 OC'd @3.9Ghz, 16Gb (TG3 benchmark 6:30)

Offline bigben

  • Member
  • *
  • Posts: 2129
  • The Long Stranger rides again
    • Tinkering with Terragen
Re: Blur mask demo
« Reply #3 on: August 02, 2007, 10:44:09 PM »
Correct.  The sharp distance in this case is defined by two shaders. The difference between the near and far distances of the Far node should be at least twice that of the difference of the Near node.
« Last Edit: August 02, 2007, 10:49:42 PM by bigben »

Offline efflux

  • Member
  • *
  • Posts: 2171
Re: Blur mask demo
« Reply #4 on: August 06, 2007, 06:51:20 PM »
The technique is cool but the problem is that it only looks good when you have something very near the camera because we would never see this narrow depth of focus in a distant landscape shot. This is why it looks like a small model. We are so used to looking at photos that we judge the realism of any render by how it conforms to what photos look like. Try the technique by having a fake stone or something very near the camera which can be in or out of focus. It will look very good.

Offline Tangled-Universe

  • Terrevangelist
  • *
  • Posts: 6183
    • CGScenery.com - Terragen Tutorials!
Re: Blur mask demo
« Reply #5 on: August 06, 2007, 09:23:33 PM »
I don't fully agree, though I can imagine your thoughts. It depends on how much blur you add while using te mask. And "this narrow depth" is just a setting which can easily be modified to have a greater depth of focus. It's just a little trial and error, subtle blurring and usage of reference material if possible.

Martin

Offline bigben

  • Member
  • *
  • Posts: 2129
  • The Long Stranger rides again
    • Tinkering with Terragen
Re: Blur mask demo
« Reply #6 on: August 06, 2007, 10:46:52 PM »
I don't agree either.  The degree of blurring in the demo was largely for demonstration purposes. If you were simulating a telephoto shot then you would expect a reduced depth of field with possible blurring in front of and behind the area of focus. If you wanted to be realistic you could calculate the depth of field for the equivalent lens/aperture combination you wanted to simulate <http://www.dofmaster.com/

For a better example try http://lucbianco.free.fr/2bgal/img.php?id_img=440 ;)

Offline Tangled-Universe

  • Terrevangelist
  • *
  • Posts: 6183
    • CGScenery.com - Terragen Tutorials!
Re: Blur mask demo
« Reply #7 on: August 07, 2007, 08:08:14 AM »
Thanks for the link Ben, could be quite handy  :)

Martin

Offline efflux

  • Member
  • *
  • Posts: 2171
Re: Blur mask demo
« Reply #8 on: August 07, 2007, 10:58:07 PM »
The screen grab may be a demo but I was just suggesting better ways to ultimately use the technique. Luc has used to it to great effect as in the link and on some other shots but it's quite difficult to get it to look right purely from our familiarity with photos. Actually even one of Luc's shots suffers from the problem:

http://lucbianco.free.fr/2bgal/img.php?id_img=433

Looks small.

Whereas this wider shot with no depth of field:

http://lucbianco.free.fr/2bgal/img.php?id_img=432

Looks very realistic.

However I think it's probably very difficult to get just right. I will test the technique myself.

No intention to be critical here just suggesting to look at photos very carefully for this technique. I know I couldn't get that narrow depth of field with my camera unless I was focused close to an object.

Offline bigben

  • Member
  • *
  • Posts: 2129
  • The Long Stranger rides again
    • Tinkering with Terragen
Re: Blur mask demo
« Reply #9 on: August 08, 2007, 10:54:48 PM »
It can be quite difficult. It's hard to comment on someone else's work without knowing the FOV of the shot.  If you pay a lot of money for a fast telephoto lens with a wide aperture (or you shoot large format film like 4x5 or 8x10) you can get this sort of effect.  The viewing distance will also be a factor. If you're too close, you're artifically increasing the fov of the image that your brain has to interpret. If you move back from the screen you may find it looks a lot better. The second image looks more like a standard FOV, especially when you compare it to the previous image in his gallery.

I'm not sure how Luc did this as I couldn't get the shader to work on object (fake stones were OK). I can think of a hack involving multiple renders, but that would be a simulation only

The depth of field link I posted was for reference to assist with creating more realistic masks, although you would also have to figure out a way to calculate the outer limits of the blur mask on either side. I'll have a look at a later stage.

 

anything