28
$\begingroup$

How can I render bokeh circles?

Nothing I do seems to work.

I tried using an empty as the focus point for a cube, with some point lamps in the background with about 2000 strength, but it doesn't work. It just makes everything blurry.

I also raised the blades to 4/5/6/12, and it doesn't make a difference.

I'm using Blender 2.74.

$\endgroup$
35
$\begingroup$

Lamps are not visible to the camera directly, and hence cannot directly make pretty bokeh shapes. To make a directly visible light source, you'll want to use a mesh light.

To do this, add an emission shader to a mesh object:

enter image description here

And now you should be able to get some bokeh:

enter image description here

Creating the bokeh object:

For creating a sharp bokeh, a small and bright object is ideal (here I used an emission strength of 20):

enter image description here enter image description here click images for better quality

For creating a blurry bokeh, use a larger object (here I used an emission strength of 1):

enter image description here enter image description here

The size of the bokeh depends on the size of the aperture and the distance from the camera to the object.

Adjusting the camera

It sounds like you have set up the camera already, but for completeness here are some settings to keep in mind:

Set the aperture size to be fairly large in order to get a shallow depth of field. When setting the aperture size directly in terms of it's radius in BU, larger values mean a larger aperture. A value of 1 is really big (1 BU = 1 meter), you'll likely want something not much bigger than .1.

You can also set the aperture size in terms of f-stops, in which case smaller values mean a larger aperture. This is mainly useful when you have a particular look you want to replicate (e.g. from a photograph), or if you're just more familiar with f-numbers.

The number of Blades in the aperture controls the number of sides on the bokeh. Values below three will make the bokeh circular. The Rotation setting rotates the aperture. This is useful for making the bokeh less straight and perfect looking.

For example, with 7 blades an little rotation:

enter image description here

Setting the Ratio to a value besides 1 will stretch the bokeh, simulating an anamorphic lens:

enter image description here

And of course you'll want to set the Focus. I usually set an empty as the focus object:

enter image description here

But you can also set the Distance by clicking in the 3D view:

  1. Press E while hovering over the slider.
  2. Click (LMB LMB) on the surface you want to focus on.

The viewport

The Viewport F-stop is used to set the size of the viewport aperture for approximating DoF real-time in the viewport. Note that this approximation is only active while in camera view (Numpad 0) with Depth of Field enabled in 3D view > Properties (N) > Shading:

enter image description here One thing you might have noticed, is that the cycles aperture and the viewport aperture give very different results.

This is because the viewport DOF is not as accurate as the cycles DOF.

To solve this issue, in Blender 2.75, there will be a new high quality checkbox for the viewport, that gives a more accurate approximation of dof.

enter image description here

When enabled using the same settings, it looks like this

enter image description here

$\endgroup$
  • 1
    $\begingroup$ viewport apertures give pretty different results [...] - in 2.75 there is a new 'high quality' checkbox which solves this issue. $\endgroup$ – p2or Jun 23 '15 at 13:40
  • $\begingroup$ @poor I just added that. $\endgroup$ – TARDIS Maker Jun 23 '15 at 16:40
  • 1
    $\begingroup$ @TARDISMaker Thanks for the addition, thats great news :D $\endgroup$ – gandalf3 Jun 23 '15 at 17:24
  • $\begingroup$ how did you multiply all the bokeh objects, did you use a particular system? $\endgroup$ – MicroMachine Oct 19 '16 at 5:34
  • 2
    $\begingroup$ @fabriced Just a particle system. The planes visible above the scene are configured to "rain" emissive Suzannes $\endgroup$ – gandalf3 Oct 19 '16 at 15:18
16
$\begingroup$

Your issue, is that you're trying to get bokeh circles using point lights. Point lights don't directly appear in the render, but appear indirectly because they cast light onto other objects. This means that they won't produce bokeh.

Instead, you should set it up using small, bright, objects. I like to use icospheres.

Here's an example I put together to help you understand how bokeh can be achieved in Blender.

enter image description here

To achieve this result, I created a scene with a camera and an empty assigned to be the focus point and I set the radius to .5.

You can also play around with the blades setting. Usually you want circular bokeh, but sometimes it's better to have hexagonal, octogonal, etc. shaped bokeh.

enter image description here

Then I created an icosphere and gave it a bright emission material.

enter image description here

I then duplicated it across the scene to give a more interesting effect.

enter image description here

$\endgroup$
  • $\begingroup$ Also play around with the blades parameter to get polygonal bokeh shapes. $\endgroup$ – Samir Rahamtalla Jun 23 '15 at 7:20
  • $\begingroup$ Since you bring it up, I'll add it. $\endgroup$ – TARDIS Maker Jun 23 '15 at 7:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.