| ZBlur |
Function
The ZBlur function is a dedicated version of IBlur used to simulate depth-of-field
blurring based on the Z channel. You can set a center point of focus (focusCenter)
and the range of drop-off to the maximum amount of blur. If you do not have
a Z
channel, you can copy a channel from another image. Therefore, if you are working
in 8 bit
or 16 bit, your ranges are between 0 and 1. For example, your focusCenter could
not be
set
to 10, but is somewhere between 0 and 1.
The ZBlur function works best with gradual changes of Z, for example, looking down a hallway, represented in the following images.
![]() |
![]() |
In cases where foreground objects overlap blurred background objects, ringing results on the background. It is recommended that you separate the foreground from the background into two separate elements. For example, do two renders if you are generating elements in 3D.
The following example is from a 3D render. Ringing appears around the background letters of the text when normally passed into a ZBlur. Instead, separate the circle into foreground and background elements with the 3D render. These are then blurred and composited in Shake.
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
|
Parameters
|
Type
|
Defaults
|
Function
|
| amount |
float
|
20 | The maximum amount of blur |
| near |
float
|
0 |
The value of distance towards the camera at which maximum blur occurs |
| far |
float
|
1 | The value of distance away from the camera at which maximum blur occurs |
| focusCenter |
float
|
(far-near)/2+near | The distance from the camera at which there is no blur. |
| focusRange |
float
|
0 | The distance away from the focusCenter, both towards and away from the camera, that remains in un-blurred. |
| steps |
int
|
5 | The amount of steps that the total range is divided between. |
| stepBlend |
float
|
1 | The mixing of the different steps. 0 means no mixing, and it good for getting a feel for your step ranges. 1 means complete, linear blending. |
Synopsis
image ZBlur( image, float amount, float near, float far, float focusCenter, float focusRange, int steps, float stepBlend );
Script
image ZBlur( image, amount, near, far, focusCenter, focusRange, steps, stepBlend );
Command Line
shake -zblur amount near far etc...
See Also
PercentBlur, Blur
, IBlur, Defocus