Almost 90% of the time I light my scenes with an HDRi background.

Is there a way to control the virtual distance of the background image so I can control bokeh and blurriness of the image when using depth of field?

Or is baking the texture onto another object the way to go?

Why do i need to do this?

I have different HDRis for different things. for Example:

  • A sunset sky
  • A cloudy sky
  • A parking lot with buildings that are close by

In the real world the buildings of the parking lot are a lot closer to the camera than the clouds of the sky and thus need to react differently to the depth of field of the camera.

My Node setup for this is pretty standard: enter image description here

  • $\begingroup$ If your parking lot hdri has an alpha channel, you could use large spheres? (It's just not very convenient for navigating, right?) $\endgroup$
    – Leander
    Commented Jul 3, 2018 at 12:07
  • $\begingroup$ I don't mind the whole image being the same distance away (like in the parking lot case: sky and buildings would have the same blurriness. That's fine). It's more about: "Well this hydra consists of mainly near objects so it needs to be less blurry). $\endgroup$
    – bstnhnsl
    Commented Jul 3, 2018 at 12:26
  • $\begingroup$ Related: blender.stackexchange.com/questions/48240/… $\endgroup$
    – user1853
    Commented Jul 3, 2018 at 14:14
  • 1
    $\begingroup$ There are multiply ways to do this, depending on how you want to store the pseudo-depth for your HDRI. (Remember, it won't be right, there's no parallax.) Storing depth is the first step. If you do make a copied HDRI containing only depth values, you can render that as an emission to a different layer and set depth equal to min of depth(layer1), color*constant(layer 2).. Or, possibly, use a UV pass, but I'm not sure offhand if world will show UV.... $\endgroup$
    – Nathan
    Commented Jul 3, 2018 at 15:47

1 Answer 1


An HDRi is infinitely far away from the camera, so it can't focus on a specific part of it. You could however map the HDRi onto other objects with a texture node so they appear part of the background but are actually 3d objects.

  • 1
    $\begingroup$ I am aware of the mapping-to-object option. and for this i dont really care about parallax or "real" depth of field. its more of a per hdri basis. a studio hdri needs to be sharp in the reflections, while maybe a sky hdri doesnt need to be. $\endgroup$
    – bstnhnsl
    Commented Apr 13, 2022 at 11:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .