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:
- Smoothness of the blur effect [1, 10].
- Blur multiplier [0, 10].
- Activate this to modify the following distortion parameters.
- Cubic distortion force [0, 20].
- Cubic distortion scale [0.01, 2].
- Activate this to modify the following color parameters.
- The color of the edges.
- Color saturation at the edges [0, 1].
- The brightness of the edges [-1, 1]. 13 The contrast at the edges [-1, 1].
- Gamma correction at the edges [0.1, 5].
- Show focus line.
- Show blur mask. This option is useful to adjust the blur zone.
- Go to the online documentation.
- Reset to default values.
The ‘Proportional’ mode can be configured with the following parameters:
- Angle of the effect [-90, 90].
- Effect aperture [0.1, 5].
- Vertical offset [-1, 1].
And the ‘Fixed’ mode:
- Width of the upper zone, in pixels.
- Width of the bottom zone, in pixels.
- 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:
If ‘myCamera’ is a valid camera and you want to add the effect, you should do something like:
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