docs.unity3d.com
    Show / Hide Table of Contents

    Chromatic Aberration

    Chromatic Aberration mimics the effect that a real-world camera produces when its lens fails to join all colors to the same point.

    For more information on the Chromatic Aberration effect, see the Chromatic Aberration documentation in the Unity Manual.

    Using Chromatic Aberration

    Chromatic Aberration uses the Volume framework, so to enable and modify Chromatic Aberration properties, you must add a Chromatic Aberration override to a Volume in your Scene. To add Chromatic Aberration to a Volume:

    1. In the Scene or Hierarchy view, select a GameObject that contains a Volume component to view it in the Inspector.
    2. In the Inspector, navigate to Add Override > Post-processing and click on Chromatic Aberration. HDRP now applies Chromatic Aberration 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
    Spectral Lut Assign a Texture to use for a custom fringing color. Leave this field empty to use the default Texture.
    Intensity Use the slider to set the strength of the Chromatic Aberration effect.
    Max Samples Use the slider to set the maximum number of samples that HDRP uses to render the Chromatic Aberration effect.

    Details

    From 2019.3, HDRP provides lookup Textures that you can use to customize this effect. These lookup Textures are for the Spectral Lut property. To add these Textures to your Unity Project, you must use the Package Manager:

    1. Select Window > Package Manager.
    2. In the Packages window, select High Definition RP.
    3. In the High Definition RP section, navigate to Additional Post-processing Data and click Import into Project next to it.
    4. The Textures that are relevant to Chromatic Aberration are in the Spectral LUTs folder, so if you only want the lookup Textures for Chromatic Aberration, only import the contents of the Spectral LUTs folder.
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023