Jump to content

DOF


Rodrix3
 Share

Recommended Posts

I am trying to use the dof postprocess which has the following parameters:

pipeline.depthOfField.focusDistance  

pipeline.depthOfField.focalLength pipeline.depthOfField.fStop 

My scene is about 1000 units long and I would like to have all near objects in blur, and all distance objects completely sharp (bokeh effect).

I tried many combinations of parameters, but unfortunately none render the result I want; and since I have zero knowledge on professional photography I would love to have some help! :)

Could anyone advise me or at least explain how those parameters work (on babylon or on a real camera)!

Thanks in advance :)

Link to comment
Share on other sites

14 hours ago, Rodrix3 said:

Could anyone advise me or at least explain how those parameters work (on babylon or on a real camera)!

I think your units are a lot.  At least in VR every unit is a meter.  I used to play a lot with bokeh effect on my camera.  Basically the lower your aperture is then your depth of focus decreases a lot, which can have some nice effects.  ie: far/near distance of field of focus decreases (ie: shallow depth of field in camera terms), but the *distance* depends on focal length.  Faster shutter speeds in low light, but sometimes even with nose in focus the ears can be blurry - I have an F1.4 lens very sharp and crazy bokeh.  Anyway on a real camera the settings are different.  Have a look at this PG - there are GUI sliders to see the effects:
https://www.babylonjs-playground.com/#THBCNW#9

Link to comment
Share on other sites

On 7/28/2018 at 2:50 PM, brianzinn said:

I think your units are a lot.  At least in VR every unit is a meter.  I used to play a lot with bokeh effect on my camera.  Basically the lower your aperture is then your depth of focus decreases a lot, which can have some nice effects.  ie: far/near distance of field of focus decreases (ie: shallow depth of field in camera terms), but the *distance* depends on focal length.  Faster shutter speeds in low light, but sometimes even with nose in focus the ears can be blurry - I have an F1.4 lens very sharp and crazy bokeh.  Anyway on a real camera the settings are different.  Have a look at this PG - there are GUI sliders to see the effects:
https://www.babylonjs-playground.com/#THBCNW#9

Thanks a lot! I really appreciate it :)

 

Should I play with focusDistance and Focal length and leave fStop intact? (I have no idea what is fStop..)

 

 @brianzinn To be able to get blurry on near and sharp on far I am looking for a small number on focal length and a big number on focal distance, correct?

 

Thanks :)

Link to comment
Share on other sites

I think the fStop is the way to play with the aperture of a traditional camera.  to make the math easy, if you have a 100mm lens (that is the focal length or lens' FOV Field of View) and when you have an fStop of f/10, then the aperture (like the pupil in your eye) diameter is 10mm.  It's just focal length/fStop = aperture diameter.

You can see this in the playground by just moving the fStop.  As you bump up the fStop to 32, your field of focus becomes much deeper.  From start of frustum to nearly to the end of the shapes.

Now to blow your mind a little bit, since you asked specifically for bokeh.  Using a stop filter you can go from 1/250th at f/16 to 1/250th at f/2.8, you will need to place five stops worth of neutral density filter over your lens.  So, with 5 stops you have the same photo with bokeh (f/2.8 will have bokeh). kaboom!  f/16 has everything in focus.  That's why I was saying 1,000 is a lot of units, because Cameras can't control bokeh at 1KM distance.  I have a 10 stop filter (big stopper) - it's so dark that you can't see through it.  I use an app to figure out the shutter speeds - it's not the easiest calculations to do when you are in a hurry - ie: fading sunset or changing lighting.  Hope that helps.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...