-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Does gvr_buffer_viewport_set_external_surface_id work with normal OpenGL textures? #378
Comments
I, too, have this question -- I'm working with an engine that assembles and manages its own framebuffer objects, hence using a framebuffer object directly with this engine is impossible without some fairly deep modification. Right now I'm working around this by resolving into GVR's swapchain framebuffer with some hacked in GL calls, but it's a notable performance/heat hit. If I can't use my own textures, can I at least get a GL renderbuffer handle or GL texture handle like in other VR platforms? |
Tried those hacks but no luck:
I know that I can render with a quad but that requires a lot of work specially in a module based architecture (loading gl symbols, shaders, etc..). It would be great to simply specify a texture_id which exists. For example, the OpenVR API allows to do that easily. |
Currently, the gvr_buffer_viewport_set_external_surface_id API is intended solely for use with the video APIs exposed by GvrLayout. See the SDK video guide for sample usage, and the SDK Video Player Sample. We'll be fleshing out this API a bit more in a future release, but note that it is currently restricted to compositing quad layers into eye space, i.e., it doesn't support arbitrary sampling from the external Surface. Would it be sufficient for the API to create and return a Surface you can provide to your codec (or rendering framework, by way of eglCreateWindowSurface())? |
@jdduke I can't speak for MortimerGoro, but as long as rendering to the surface is as fast as using gvr_frame_bind_buffer is (without the need to copy) and there's no other performance penalty, that would work well in my case. |
I got it working attaching the texture to a custom fbo and using BlitFramebuffer ;) @jdduke In my case I wouldn't use that API because I can't change the surface where the "framework" renders to. |
Hello,
I want to use an already rendered OpenGL texture in gvr_frame_submit, without using buffer specs. The texture is a normal GL_TEXTURE_2D (not a GL_TEXTURE_EXTERNAL_OES or a surface from the video stream from Android). Can I use this texture with the external_surface_id API?
I'm using the API like this, but crashes on gvr_frame_submit call.
Create swap chain with empty spec list
gvr_swap_chain_create(ctx, NULL, 0)
Set external texture ids
Set buffer indices
Submit frame
gvr_frame_submit(frame, .viewport_list, head_matrix)
The text was updated successfully, but these errors were encountered: