Google VR (daydream)

127 views
Skip to first unread message

Louise Cypher

unread,
May 22, 2016, 6:32:59 PM5/22/16
to android-ndk
Hi 

Is there any 'special' group to discus new google VR sdk (from NDK point of view) or this group is OK ?

If it's OK. Then I have some feature request regarding the VR NDK functionality.
For now the usage pattern is (cut'n'paste from GVR NDK):

//     while (client_app_should_render) {
//       // A client app should be ready for the render target size to change
//       // whenever a new QR code is scanned, or a new viewer is paired.
//       gvr_sizei render_target_size =
//           gvr_get_recommended_render_target_size(gvr);
//       int offscreen_texture_id =
//           AppInitializeOrResizeOffscreenBuffer(render_target_size);
//
//       // This function will depend on your render loop's implementation.
//       gvr_clock_time_point next_vsync = AppGetNextVsyncTime();
//
//       const gvr_head_pose head_pose =
//           gvr_get_head_pose_in_start_space(gvr, next_vsync);
//       const gvr_mat4f head_matrix = head_pose.object_from_reference_matrix;
//       const gvr_mat4f left_eye_matrix = MatrixMultiply(
//           gvr_get_eye_from_head_matrix(gvr, GVR_LEFT_EYE), head_matrix);
//       const gvr::Mat4f right_eye_matrix = MatrixMultiply(
//           gvr_get_eye_from_head_matrix(gvr, GVR_RIGHT_EYE), head_matrix);
//
//       // A client app does its rendering here.
//       AppSetRenderTarget(offscreen_texture_id);
//
//       AppDoSomeRenderingForEye(
//           left_eye_params.eye_viewport_bounds, left_eye_matrix);
//       AppDoSomeRenderingForEye(
//           right_eye_params.eye_viewport_bounds, right_eye_matrix);
//       AppSetRenderTarget(primary_display);
//
//       gvr_distort_to_screen(gvr, frame_texture_id, render_params_list,
//                             &head_pose, &next_vsync);
//       AppSwapBuffers();
//     }

now to have my own postprocessing shader (that for example does tonemapping / color correction of final image)
I need to allocate one more renderbuffer, render to it my 3d scene and then process it using my shader to the renderbuffer provided by GVR.
This is cleanly BIG waste of resources, as the 'postprocess' part could be done inside the shader responsible for distortion, but with current API there is no access to it.
(this is question mainly to google devs) Are there any plans to extend the API, to allow user execution of it's own shader instead of the one provided by gvr_distort_to_screen ?
I'm especially interested in this in pair with the scanline racing magic enabled (as without the scanline racing magic I'm able to do the distortion myself and it seemd to render just fine)






--
Code it black!

Glenn Kasten

unread,
May 22, 2016, 6:37:53 PM5/22/16
to android-ndk
According to the links at the bottom of the
page "Google VR SDK for Android" 
at https://developers.google.com/vr/android/
and page "Getting Started"
Reply all
Reply to author
Forward
0 new messages