Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table Of Contents

Table of Content Zone

Table of Contents
excludeTable Of Contents

Introduction

Attaching the RedshiftBokeh lens shader to a camera provides Depth-Of-Field controls. This allows the camera to 'focus' on individual objects and blur the rest of the image.

The focusing happens at a specific distance from the camera.

Table Of Contents

Table of Contents
excludeTable Of Contents

How To Use

You can enable bokeh via the "Redshift Bokeh" lens shader as shown below.


Hide content
productsoftimage

...


Image Added

On the camera's Lens Shaders tab, click "Add" and, from the list that appears, select Redshift Bokeh


Image Added


Hide content
productmaya

...


Image Added

On the camera's Redshift properties, click the checkerboard icon next to "Lens Shaders". Then from the list that appears, select RedshiftBokeh


Image Added


Hide content
product3dsmax

...


Image Added

In the "Rendering" menu, click "Environment". On the "Environment and Effects" window, go to the "Effects" tab. Click "Add" and, from the list that appears, select "Redshift Bokeh"


Hide content
productcinema4d

To Bokeh effect is available via the Redshift Camera tag. If the camera doesn't have one already, one can be created by right-clicking on the camera object and selecting the Redshift Camera tag from the Redshift Tags sub-menu.

Image Added


The settings for this effect are under the Bokeh tab of the Redshift Camera tag

Image Added


Hide content
producthoudini

The Bokeh DOF effect is available using the custom camera properties that can be added as spare parameters by selecting the camera node and clicking  the  CamParms  icon in the Redshift toolbar.

Image Added


Hide content
productkatana

The Bokeh DOF effect is available inside the RedshiftRenderSettings node, Camera, DOF tab.

Image Added

Focus Settings

Derive Focus Distance From Camera

Cameras in 3D modeling packages often have specific controls for their "interest", i.e. the 3D position that the camera is focusing on. If you enable this option, the camera interest will be used by Redshift to determine the focus distance.

Focus Distance

If "Derive Focus Distance From Camera" is disabled, you can type in a specific value for the focus distance. This can be useful if the camera is already tracking a specific object but you actually want to focus on a different distance.

 

Rs divbox
classrs-img-table2

...


Image Added

...

Image Added

Adjusting "Focus Distance" to focus on the face.

Adjusting "Focus Distance" to focus on the hand.

...


...

 CoC Radius

"CoC" stands for "circle of confusion". This parameter controls how strong the Depth-Of-Field effect will be. Smaller values keep a larger range around "Focus Distance" in focus, i.e. more of the image is in focus. Larger values make the effect stronger – only parts of the image exactly at a "Focus Distance" will be sharp, everything else will be blurry.


Info

The circle of confusion works in conjunction with the F-stop of your camera using the formula below.

dofRadius = focalLength / fStop / 2 / (mm in scene units)


Rs divbox
classrs-img-table2

...


Image Added

...

Image Added

...

Image Added

CoC Radius 2.0

CoC Radius 5.0

CoC Radius 10.0

...


 Power

...


Info

...

This parameter has no effect when you use a bokeh image. If you're using a bokeh image, you can simulate this effect by multiplying your image by a radial gradient which is dark in the middle and bright on the edges.

You can think of out-of-focus pixels as blurry disks. The blurrier a pixel is, the larger the disk. The "Power" parameter controls how these disks appear.

The default 1.0 value makes the disk intensity even. Values lower than 1.0 make the center of the disks more important than the outer parts. Values greater than 1.0 have the opposite effect: they make the outer parts of the disk more important. This is better explained with the images below:

 

Rs divbox
classrs-img-table2

...


Image Added

...

Image Added

...

Image Added

Power 1.0. This is the default value.

Power 0.5. The Depth-Of-Field becomes tighter.

Power 10.0. A "double vision" effect.

...


...

 Aspect

The aspect parameter can squash the depth-of-field effect and simulate the effect observed on anamorphic lenses. The default 1.0 value produces a perfectly circular disc while values less than 1.0 or greater than 1.0 will respectively squash the shape vertically and horizontally.

On the following scene we lit our model using a few spherical lights. Looking at the following examples, please observe that 0.8 = 1.0 / 1.25.
In other words, if you want to maintain the same amount of aspect, but want it on the opposite axis, you'll need to use the reciprocal of your value.

 

Rs divbox
classrs-img-table2

...


Image Added

...

Image Added

...

Image Added

Aspect 1.0. This is the default value.

Aspect 0.8. The Depth-Of-Field shape becomes longer on the Y axis.

Aspect 1.25. The Depth-Of-Field effect becomes longer on the X axis.

...



...

 Shutter Blades

Blade Count / Angle

Info

This parameter has no effect when you use a bokeh image

...

The "Angle" parameter controls the angle of the effect. If the shape is a disk, this has no effect.

 

Rs divbox
classrs-img-table2

...


worddavaa8f9278e01b64aec5d50b867e3c9880.pngImage Added

...

Image Added

...

Image Added

Blade Count 0.0 (disk)

Blade Count 3 (triangle). Angle 0.2

Blade Count 3 (triangle). Angle 0.7

...



Bokeh

Use Bokeh Image / Image Normalization

Apart from the vignetting effect, real-life camera lenses sometimes also exhibit an artifact called "chromatic aberration". Chromatic aberration means that, depending on the angle of the light reaching the lens, certain light wavelengths (colors) are reflected away and never reach the camera. This creates a rainbow effect which is stronger in parts of the image that are out-of-focus. Just like vignetting, even though this is an artifact sometimes it is desired for artistic reasons.

Redshift allows you to use an image for Depth-Of-Field which can help simulate the chromatic aberration effect. Such an image is shown below.


Image RemovedImage Added

To get a neutral result in the focused pixels one would have to draw this picture perfectly. I.e. there should be exactly the same number of red pixels to blue to green. Not doing so would mean that the image would either be too red or too green or too blue and also too dim.

...

The examples below show the different normalization modes in action:

 

Rs divbox
classrs-img-table2

...


Image Added

...

Image Added

...

Image Added

Normalization set to "None". The in-focus pixels are tinted and look darker

Normalization set to "Unit Intensity". The image is brighter (like the original), but there is still tint because of the red circle being chopped off (so green and blue 'win'). Sometimes following the color balance of the bokeh image is desirable.

Normalization set to "White Color Sum". The image is now normalized so that all its pixels add up to white. This removes any unwanted tinting in the in-focus pixels