Search Results for

    Compositor Layers

    VR compositor layers are good for rendering text, video, or texture and for displaying simple environments and backgrounds. This document explains how to use the VR compositor layers capability provided by the SDK.


    Using VR compositor layers can enhance rendering speed and quality. In general, when rendering VR content, the left-eye and right-eye cameras first render the content to the eye buffer, and then the ATW thread distorts and samples the eye buffer, after which the content is rendered to the screen. With VR compositor layers, the content is directly passed to the ATW thread for processing such as distortion, sampling, and synthesis, thus simplifying the rendering process.

    Notes

    • It is recommended that you limit the number of VR compositor layers for a single scene to 8.

    • VR compositor layers may not be used as subcomponents of camera components.

    • Place models and overlay layers using the correct coordinate relationships, for example, following the rule that near objects obscure distant objects; otherwise there will be depth-of-field conflicts that can cause visual discomfort.

    Create Compositor Layer

    Refer to the following steps to create a compositor layer. You can also refer to Unreal Engine documentation OpenXR Stereo Layers Quick Start to create a layer based on the VR template project.

    1. In the bottom left corner of the editor, click Add/Import > Blueprint Class, create a Pawn that desired to be used in conjunction with a VR compositor layer.

    2. You can add a VR compositor layer in one of two options.

      • Option A: Drag the previously created pawn into the level and select the pawn. To the right of the editor, click + Add Component > Stereo Layer.

      • Option B: Under the Content Browser, double click the previously created pawn. In the top left corner of the window that opens, click + Add Component > Stereo Layer.

    3. Once you have added the compositor layer, to the right of the editor, under Details panel, you can set its parameters under the Stereo Layer and the Stereoscopic Properties tabs.

    Stereo Layer Parameter Description

    Under the Stereo Layer tab, you can set the following parameters:

    Parameter Description
    Live Texture Controls the layer texture if it needs to update itself every frame (scene capture, video, and so on). If yes, check this option.
    Support Depth Controls the layer if it needs to support depth intersections with the scene geometry. By default, VR compositor layers are always displayed on top of all other objects in the scene. Check this option if you want to set layers to respect depth positioning. Note: Checking this option may affect performance.
    No Alpha Channel Controls the layer texture if it uses its own Alpha channel. Check this option if not.
    Texture Texture displayed on the layer.
    Quad Preserve Texture Ratio Controls the scale of the layer if it is displayed according to the scale of the texture. If yes, check this option.
    Quad Size Size of the rendered layer quad.
    UV Rect UV coordinates mapped to the quad face. UV(0,0) for the top left corner and UV(1,1) for the bottom right corner.
    Stereo Layer Type Specifies which space the layer's position and rotation are relative to. SDK supports the following types:
    • World Locked: No matter how the HMD is moved or rotated, the layer stays in a given position in the world.
    • Tracker Locked: The position of the layer component remains stationary relative to the position of its parent component.
    • Face Locked: No matter how the HMD is moved or rotated, the layer stays in a fixed position in the view.
    Stereo Layer Shape Specifies the shape of the layer. SDK supports Quad Layer, Cylinder Layer, Equirect Layer and Cubemap Layer.
    Priority If you have multiple layers, you can set the depth order in which the layers will be displayed. Lower values indicate higher priorities.

    Under the Stereoscopic Properties tab, you can set the following parameters:
    Parameter Description
    Left Texture Texture displayed on the layer for the left eye, if stereoscopic textures are supported on the platform.

    Stereo Layer Shape Parameter Description

    YVR SDK supports Quad Layer, Cylinder Layer, Equirect Layer and Cubemap Layer. The parameter descriptions are as follows:

    Shape Description Settings
    Quad Layer A flat texture with four vertices, which is normally used to display text or information.
    Cylinder Layer A texture with cylindrical curves, which is normally used to display curved UI.
    • Radius: Radius of the cylinder layer
    • Overlay Arc: Arc angle for the cylinder layer
    • Height: Height of the cylinder layer
    Equirect Layer Sphere texture, which is normally used to display 180/360 panoramic images or videos. If you specify the layer shape as Equirect, it is recommended that you set the following properties for the layer:
    • Check No Alpha Channel
    • Check Quad Preserve Texture Ratio
    • Set Stereo Layer Type as World Locked
    If you specify the layer shape as Equirect, you can set the following properties for the layer:
    • Left UVRect: Display range for the left eye texture.
    • Right UVRect: Display range for the right eye texture.
    Cubemap A cubemap consists of six square textures that represent the reflections on an environment. The six square textures form the faces of an imaginary cube that surrounds an object, and each face represents the view along a specific direction of the world axes, including up, down, left, right, front, and back.
    In This Article