Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

Question Flickering artifact in rendering with OpenGL ES 3.1 openxr android native plugin

Discussion in 'VR' started by nfynt-zap, Sep 13, 2022.

  1. nfynt-zap


    Jun 3, 2021
    I am trying to write an OpenXR plugin for Unity based on Unity XR-SDK( targeting android platform with GLES 3.1. So far I've got a basic rendering and 3Dof view tracking in place and working with Monado in-process runtime. I am however getting an odd flickering rendering effect, which seems like a black frame composition in every alternate frame (flickering_video: and flickering_video_slomo:

    Here's my rendering loop with Unity plugin
    Code (CSharp):
    1. xrWaitFrame
    2. xrBeginFrame
    4. // for each views (2 here for multi-pass stereo)
    5. xrAcquireSwapchainImage
    6. xrWaitSwapchainImage
    8. Unity rendering - multithreaded
    10. xrReleaseSwapchainImage x (number of views = 2)
    12. xrEndFrame

    Comparing to hello_xr from OpenXR-SDK-source the only difference seems to me is that I am acquiring both the swapchains (left and right views) before starting of rendering and releasing them before calling xrEndFrame. Whereas hello_xr does: acquire->render->release for each views sequentially.

    Any ideas or insights are appreciated.

    Bellow is the test apk if you want to try, please note you'll need android broker and runtime to test the application.
    [Unity apk]
    [Android broker]
    [Android runtime]
    KazantsevPE and Hobodi like this.
  2. KazantsevPE


    Nov 1, 2018
    Good afternoon Were you able to find a solution?