docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Display video on composition layers

    You can use Composition Layers to display high resolution videos in a Head-Mounted Display (HMD) at full resolution. With Composition Layers, the resolution isn't limited to the resolution of the Eye Buffer, or affected by distortion and sampling from the render pipeline.

    Refer to the following sections to understand the Video types you can use with composition layers, and Add video to a composition layer.

    Video types

    The following table describes the recommended composition layer for different types of video:

    Video type Composition layer
    Rectangle video Quad or Cylinder
    360 degree video Equirect
    Stereo video Projection

    Refer to Composition layer component for more information about the types of composition layer.

    Add video to a composition layer

    To add a video to a composition layer, you must first:

    • Import your video file into your Unity project.
    • Create a composition layer of appropriate display. Refer to Video types to choose an appropriate composition layer for your video type.

    Follow these steps to display your video on the composition layer:

    1. Add a Video Player component to a GameObject (Hierarchy window: Right-click on your chosen GameObject > Video > Video Player).
    2. In the Inspector window of the Video Player component, select your imported video file in the Video Clip field.
    3. Go to Assets > Create > Rendering Render Texture to create a new Render Texture.
    4. Open the Video Player component and view it in the Inspector window.
    5. In the Target Texture field, assign your custom Render Texture you created in step 3.
    6. Open the composition layer you created in the Inspector window.
    7. In the Source Textures component, under Source, select Local Texture and add the Render Texture you created in step 3.

    When you enter Play mode, you can now observe the video clip displayed on the composition layer.

    Video clip shown in the Scene view. The Inspector window displays composition layer settings configured to display a video clip.
    Composition layer settings configured to display a video clip.

    Note

    The video clip will not display on the composition layer until you enter Play mode for the first time, after which the first frame on the video will display on the Composition Layer in the Scene view and the Game view.

    In This Article
    Back to top
    Copyright © 2024 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)