Dep of Field Question

Hi,
I am desperatly trying to blur everything except everything between
lets say 10 - 100 m distance.
however, this is not working, since I only can set the distance and it appears to be just a single position and not a range.

Since there is no Start-End Option in the Camera, is there any other way to achieve this?

I don’t know how you want to control it, but you can control it to some extent.

Depth of field increases with depth
 blurring the midground but not the background is not in any sense of the word depth of field. What you actually want to do is render multiple layers- fore, mid, back- and blur the mid layer in your compositor

this is a mid understanding, I dont want to blur the mid.
I want to Blur fore and Background but want to specifically set the it from Xm - Ym 


However, the eithe either the background is not blurry enough or the foreground is too blurry

I think what OP wants is the opposite of this, he/she wants to blur the midground.

I speak as a photographer here, and i also teach about it. I could only say that in theory (depends on your focal length, aperture, sensor size and focus distance), it is possible, but it depends on how wide/far you want your depth of field is, because starting at certain range, you’ll achieve what is called hyperfocal distance, where everything behind the focus point is (visually) in focus, because the CoC (circle of confusion / the minimum blur radius one could perceive as a sharp/focused image) is also getting smaller because of the perspective.

hope that helps.

By default, Blender only show the focus point/distance, but using an addons, you can visualize the actual DoF (here’s I’m using photographer addons)

there’s also a free addons to visualize this GitHub - p2or/blender-dof-utils: depth of field utilities, i use that addons before the photographer addons implemented this feature

you can also use DoF calculator to know how far your actual DoF is, just google it and you’ll find it.

Here’s one of possible setting if you want to achieve ±80m of DoF:

  • Sensor Size: FullFrame 35mm
  • Focal Length: 135mm
  • Aperture: f/40
  • Focus Distance: 13m

You’ll get a total of approx. 83m of DoF, from 7m to 90m.

2 Likes

Something that I find very useful is to take my 35mm [digital] camera with a real lens, walk outside and point it at something, then try to achieve the effect that I’m looking for. Notice what camera settings do that. You can also quickly fiddle with various options.

Blender will simulate the same thing very well, but sometimes the fastest thing to do is to literally “look” using a real device. (Note that “your phone’s digital zoom” won’t be the same.)

1 Like

Agreed! That’s why i wrote “as a photographer”, in theory, it is possible, but in practice, not really, because real cameras always have some limitations, especially if the photorealistic image is one of the targets of the final render.

On the other hand, if i wrote “as a 3D artist”, then, just do it! Almost everything is possible, your only limitation is the floating point precision of the camera setting😄

So basicly, Blender is emulating a real cameras DOF functionality.
SInce it is digital, non real world, we are making pictures in, wouldn’t it be usefull
to have more options here.

Like really just say
 everything between X and Y is blurred Amount of Z 


Using Blender (Cycles) camera? i don’t think it’s possible, as the blur amount isn’t uniform between X and Y, at which point is the blur amount of Z applied? I guess compositing is the solution if you want the blur amount to be uniform, maybe it is possible with EEVEE camera, as it has this parameter

image

But I’m not sure if it works as a multiplier or not.

Why not use 3rd party apps to achieve the result you want?

is there any?

I mean like even Photoshop and such. Just select the area where you want to add some blur and you’re good to go.

Yeah,
well
 I did. However. It is always a good amount of time spent to do this 

I would like to have results on render since it is 
 quicker. I want to try out different settings and so


Yeah, I know what you’re talking about, trying to get as much as you can from Blender without using any 3rd party apps., and that’s good. I tried doing the same thing with blurring only some specific areas in Blender by invoking using other apps, but couldn’t and eventually got away with that using Paint’s net blur paint brush tool.

It’s up to you anyway. I just mean why make a mountain out of a molehill if you could just use some other ways to achieve your result? Just thinking out loud.

Anyway, hope you’ll get what you want

The solution is to make a material that outputs the distance of each object in your scene relative to the camera. Knowing that distance, you can render a mask with the min and max thresholds of your choice.

Here’s how to do it:

  1. In your scene, append the material in the blend file I included below. Use that material in the Override panel. This material outputs black if the distance of an object from the camera is between two values, white otherwise. Don’t forget to set the World background to white if you don’t want it to be blurred. Before rendering, type the location coordinates of the camera where it says “Location of camera”.
  2. Render and save the result. You will see that parts of the scene are white, while others are black.
  3. In the compositor, take what you just rendered and use it as a mask. Black means no blur and white means full blur.

custom blur range.blend (600.6 KB)