Tilt Shift - Unity Asset Store - Nephasto

Tilt Shift makes the scene seem much smaller than it actually is, simulating the shallow depth of field normally encountered in close-up photography.

🕹️ Demo  🛒 Store


Once installed, select the camera of the scene and add the component ‘Tilt Shift’.


When you add it you will see something like:


With ‘Strength’ (1) you can select the strength of the effect. In ‘Mode’ (2) you can select how the screen resolution affects the effect.

The first is ‘Proportional’ (by default) and causes the effect to be ‘stretched’ to fit the screen size. The second, ‘Fixed’, is independent of the screen resolution.

Each mode has different parameters, which we will see later. The rest of the parameters are:

  1. Smoothness of the blur effect [1, 10].
  2. Blur multiplier [0, 10].
  3. Activate this to modify the following distortion parameters.
  4. Cubic distortion force [0, 20].
  5. Cubic distortion scale [0.01, 2].
  6. Activate this to modify the following color parameters.
  7. The color of the edges.
  8. Color saturation at the edges [0, 1].
  9. The brightness of the edges [-1, 1]. 13 The contrast at the edges [-1, 1].
  10. Gamma correction at the edges [0.1, 5].
  11. Show focus line.
  12. Show blur mask. This option is useful to adjust the blur zone.
  13. Go to the online documentation.
  14. Reset to default values.

The ‘Proportional’ mode can be configured with the following parameters:

  1. Angle of the effect [-90, 90].
  2. Effect aperture [0.1, 5].
  3. Vertical offset [-1, 1].

And the ‘Fixed’ mode:

  1. Width of the upper zone, in pixels.
  2. Width of the bottom zone, in pixels.
  3. Width of the falloff zone, in pixels.


All code is inside the namespace ‘Nephasto.TiltShiftAsset’ and main component is ‘TiltShift’. So if you want to use it you must first import its namespace:

 using Nephasto.TiltShiftAsset;


If ‘myCamera’ is a valid camera and you want to add the effect, you should do something like:

 TiltShift tiltShift = mycamera.gameObject.AddComponent<TiltShift>();


All the code are well commented, I recommend reading the code if you want more information.

Any questions or suggestions you have, I will be happy to answer you in