Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

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?