GearVRf icon indicating copy to clipboard operation
GearVRf copied to clipboard

Transparent Rendering Background

Open unnikrishnan-anil opened this issue 7 years ago • 2 comments

I am trying to use the framework in mono-camera mode as a regular Android application. Is it possible to have the background of the context set to alpha=0.0f? I want to set it up such that I'll be able to see buttons in the layout that is behind the GL context.

unnikrishnan-anil avatar Nov 03 '17 17:11 unnikrishnan-anil

Hi there. I assume you mean you're running in monoscopic mode (probably fullscreen as well?) that is specified in the gvr.xml file? If so, there's nothing exposed for doing what you are looking for. This was not an imagined use case when that code was written :)

That being said, our code is open-source and you can modify to your hearts content :). The monoscopic code is in backend_oculus/src/main/java/org/gearvrf/OvrMonoscopicRenderer.java and OvrMonoscopicViewManager.java. You can modify the GLSurfaceView we use to be on top and transparent like a normal GLSurfaceView.

You might just need to setZOrderOnTop(true); with the GLSurfaceView and you're done. Maybe. You'll have to try it. Here's a StackOverflow link of putting a transparent GLSurfaceView over a regular view:

https://stackoverflow.com/questions/23628989/glsurfaceview-transparent-background-and-overlay-view-on-top-of-it

hope that helps, tom

thomasflynn avatar Nov 04 '17 02:11 thomasflynn

Thanks @thomasflynn I'll take a look at it and see how it works for me.

unnikrishnan-anil avatar Nov 04 '17 17:11 unnikrishnan-anil