Vignette
In Photography, vignetting is the term for the darkening or desaturating towards the edges of an image compared to the center. In real life, thick or stacked filters, secondary lenses, and improper lens hoods are usually the cause of this effect. You can use vignetting to draw focus to the center of an image.
Using Vignette
Vignette uses the Volume framework, so to enable and modify Vignette properties, you must add a Vignette override to a Volume in your Scene. To add Vignette to a Volume:
- In the Scene or Hierarchy view, select a GameObject that contains a Volume component to view it in the Inspector.
- In the Inspector, go to Add Override > Post-processing and select Vignette. HDRP now applies Vignette to any Camera this Volume affects.
API
To access and control this override at runtime, use the Volume scripting API. Because of how the Volume system works, you edit properties in a different way to standard Unity components. There are also other nuances to be aware of too, such as each property has an overrideState. This indicates to the Volume system whether to use the property value you set, or use the default value stored in the Volume Profile. For information on how to use the API correctly, see Volume scripting API.
Properties
Property | Description |
---|---|
Mode | Use the drop-down to select the vignette display mode. • Procedural: Select this mode to expose properties that control the position, shape, and intensity of the vignette. •Masked: Select this mode to use a texture mask to create a custom vignette effect. Use this mode to achieve irregular vignetting effects. |
Color | Use the color picker to set the color of the vignette. |
Center | Set the vignette center point. For reference, the screen center is [0.5, 0.5]. This property only appears when you select Procedural from the Mode drop-down. |
Intensity | Use the slider to set the strength of the vignette effect. This property only appears when you select Procedural from the Mode drop-down. |
Smoothness | Use the slider to set the smoothness of the vignette borders. This property only appears when you select Procedural from the Mode drop-down. |
Roundness | Use the slider to set the roundness of the vignette. Higher values result in a more round vignette. This property only appears when you select Procedural from the Mode drop-down. |
Rounded | Enable the checkbox to make the vignette perfectly round. Disable the checkbox to make the vignette match the shape on the current aspect ratio. This property only appears when you select Procedural from the Mode drop-down. |
Mask | Assign a Texture to use as the vignette. This should be a black and white mask. This property only appears when you select Masked from the Mode drop-down. |
Opacity | Use the slider to set the opacity of the mask vignette. This property only appears when you select Masked from the Mode drop-down. |