Forum Discussion
treytech
7 years agoExplorer
Integrating OVROverlay with external Unity Plugin
I have an Oculus Go application in Unity 2017.4.1f1 that is using a custom Android plugin to playback video. In my current setup, the Android plugin is creating its own OpenGL context that is shared with the Unity context. I create textures in the plugin that have video data drawn into, then I render those textures over in Unity via an External Texture created with the OpenGL name provided by the plugin. This works fine and dandy, but I'm wanting to render the video frames with the timewarped OVR Layers.
However, as far as I can tell, the Unity integration in OVROverlay.cs is primarily used to render a RenderTexture from Unity, or to render a Texture that is already in the project and/or scene hierarchy. I've tried a few different methods to get it to work with my plugin, and none have worked:
However, as far as I can tell, the Unity integration in OVROverlay.cs is primarily used to render a RenderTexture from Unity, or to render a Texture that is already in the project and/or scene hierarchy. I've tried a few different methods to get it to work with my plugin, and none have worked:
- I've tried just simply passing my external textures into the OVRPlugin.EnqueueSubmitLayer call, and I tried setting the layer flag to OVRPlugin.LayerFlags.NoAllocation, which I assume means that the Plugin isn't allocating its own textures, but letting me just pass them in. I just get a distorted black texture where the timewarp layer should be. (Is this because the OpenGL context used by the OVRPlugin isn't sharing textures with my plugin's context?)
- I've tried letting the OVRPlugin allocate its own textures, then pass those into my plugin and having it write to the textures. This causes OpenGL errors with flushing and displays nothing in the application.
- I've tried letting the OVRPlugin allocate its own textures, then using Graphics.Copy to copy my external plugin textures to the OVRPlugin allocated textures. This would be bad for performance I'm assuming, but also doesn't work and displays nothing in the application.
1 Reply
Replies have been turned off for this discussion
- vk10Honored Guest@treytech : were you able to solve this original problem (with our without 1.29) ? Thanks!
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 6 years ago
- 6 years ago