During implementation of XRDisplaySubSystem, can not get SinglePass Texture Successfully.

Hi, everyone,

I am currently adapting our AR-Glasses Unity SDK into UnityXR and am following the instructions of the official Project “unity-xr-sdk-v1” to learn and test some key features about UnityXR.

However, I have encountered an issue while implementing the DisplayProvider for the XRDisplaySubsystem. Specifically, the SinglePass Texture (GL_TEXTURE_2D_ARRAY, with two slices) is not rendering anything.

I have used one renderPass and two RenderParams for this particular feature, which is the same as the official project. I have also tried allocating the texture (GL_TEXTURE_2D_ARRAY) both manually and through Unity.

To check if the SinglePass Texture is available, I am using glReadPixels and PNG-saving on the callback of SubmitCurrentFrame. However, I am experiencing some problems:

  • If Unity’s XROrigin’s main camera uses Skybox, nothing is shown on the texture, and the pixels are all (0, 0, 0, 0).
  • If Unity’s XROrigin’s main camera uses a solid color, with a particular background color, the texture is the same background color with no 3D objects rendered on it.
  • If SinglePass is closed, I can get the correct texture by using MultiPass in the native.

My Device is of Android Platform, Androd12, with Snapdragon XR2.

Any help or advice on how to resolve these issues would be greatly appreciated. Thank you.

This question is not clear enough, and I should close it.