docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Composition layer transparency

    Composition layers are drawn in order from most negative to most positive. A completely opaque area of a layer obscures any layers already drawn. To use alpha blending to allow lower layers to show through upper layers, you must manually configure camera, HDR, and Post-processing settings:

    • Configure the camera for transparency
    • Configure HDR settings
    • Configure Post-processing settings

    If you do not configure these settings correctly, the following types of layers might not render correctly:

    • Underlays (layers with compositing order < 0)
    • Transparent layers
    • Projection Eye Rigs
    Tip

    Layers that are drawn underneath the main scene are sometimes called underlays and those that are drawn on top are sometimes called overlays. While the XR Composition Layers package doesn't use these terms explicitly, you might see them used in other XR literature. The main camera renders to the default scene layer, which always has an order of zero. Layers with a negative order are drawn underneath this layer and correspond to underlays. Layers with a positive order are drawn on top and correspond to overlays.

    Note

    Compositing in the Editor is emulated by shaders and can produce different results than the hardware compositor on an XR device. Always verify your layer setup on device.

    Configure the camera for transparency

    Unity renders the main camera to the default scene layer, which is drawn at order zero. By default, the camera background is completely opaque and obscures anything in layers with a negative order value. Set the camera background to transparent to allow layers with a negative order (underlays) to be seen.

    To configure the main scene camera in an XR scene to render with a transparent background:

    1. Select the Camera GameObject in the scene Hierarchy (typically under XR Origin > Camera Offset).
    2. Adjust settings based on your render pipeline:
      • Universal Render Pipeline (URP): In the Environment section, set Background Type to Solid Color.
      • Built-In Render Pipeline: Set Clear Flags to Solid Color.
    3. Open the Background color picker and set A (Alpha) to 0.

    The same considerations apply when you render objects to a render texture and use that texture as the source of a composition layer. If you want layers underneath to be visible in the background areas, you must set the rendering camera's background color to be transparent.

    Note

    The cameras of the Projection Eye Rig use a transparent background by default.

    Configure High Dynamic Range (HDR) settings

    In order to store information to the alpha channel, the format of the render texture the scene is rendered to must contain an alpha channel. Some HDR rendering formats drop alpha channels for improved performance, but this can prevent layers underneath the default scene layer from being visible.

    If you are using HDR, ensure your graphics Quality or Tier settings are set to allow the scene to be rendered with an alpha channel. Otherwise, you must disable HDR in the project settings.

    Refer to HDR Tone mapping component for information about the Composition Layers tone mapping component.

    Universal Render Pipeline (URP)

    To change HDR settings when using URP:

    Tip

    By default, the PC_RP Asset configures URP settings for standalone builds (Windows, macOS, Linux), while the Mobile_RP Asset optimizes settings for Android builds. Ensure you modify all the correct RP Asset and Renderer for your target platform.

    1. Locate your project's render pipeline assets. (By default these assets are stored in the Assets/Settings folder in the Project.)

    2. For each render pipeline asset:

      1. Select the asset to view its properties in the Inspector.
      2. In the Quality section, enable or disable HDR.
      3. If you enable HDR, set HDR Precision to 64 Bits.

    Disabled HDR in URP
    Disabling the HDR setting in a render pipeline asset

    Modified HDR Percision Setting in URP
    Modifying the HDR Percision setting in a render pipeline asset

    Note

    If the Inspector doesn't show the HDR Precision setting, you must change the Advanced Properties preference to All Visible:

    1. Open the Unity Preferences window.
    2. Select the Graphics section.
    3. Set the Advanced Properties setting to All Visible.

    Built-In Render Pipeline

    To change HDR settings when using the Built-In Render Pipeline:

    1. Open the Project Settings window.

    2. Select the Graphics section.

    3. Locate the Tier Settings for Built-In.

    4. Click the Open Editor button to open the Tier Settings editor.

    5. Change the HDR settings to the desired value for each tier that your project uses:

      1. Deselect the Use Defaults option.
      2. Enable or disable the Use HDR option.
      3. If you enable HDR, set HDR Mode to FP16.

    HDR Tier Settings
    FP16 mode in Graphics Tier Settings

    Refer to Graphics settings for the version of Unity that you are using for more information about changing graphics settings.

    Configure Post-processing settings

    Post-processing effects in URP may discard alpha channel data. To preserve the composition layer alpha channel, enable Alpha Processing or disable Post-processing entirely.

    To enable Alpha Processing:

    1. Locate your project's render pipeline assets. (By default these assets are stored in the Assets/Settings folder in the project.)

    2. For each render pipeline asset:

      1. Expand the Post-processing section, if necessary.
      2. Enable Alpha processing.

    Alpha Processing Enabled
    Enabled Alpha Processing setting in a render pipeline asset

    To disable Post-processing:

    1. Locate your project's Universal Renderer Data assets. (By default these assets are stored in the Assets/Settings folder in the project.)
    2. For each renderer data asset, uncheck the Enabled option in the Post-processing section.

    Post-processing disabled
    Post-processing disabled in a renderer data asset

    Refer to Post-processing in URP for more information about Unity post-processing features.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)