void onDrawEye ( int eye , int swapChainIndex , boolean use_multiview ) { mCurrentEye = eye ; if ( ! ( mSensoredScene == null || ! mMainScene . equals ( mSensoredScene ) ) ) { GVRCameraRig mainCameraRig = mMainScene . getMainCameraRig ( ) ; if ( use_multiview ) { if ( DEBUG_STATS ) { mTracerDrawEyes1 . enter ( ) ; // this eye is drawn first mTracerDrawEyes2 . enter ( ) ; } GVRRenderTarget renderTarget = mRenderBundle . getRenderTarget ( EYE . MULTIVIEW , swapChainIndex ) ; GVRCamera camera = mMainScene . getMainCameraRig ( ) . getCenterCamera ( ) ; GVRCamera left_camera = mMainScene . getMainCameraRig ( ) . getLeftCamera ( ) ; renderTarget . cullFromCamera ( mMainScene , camera , mRenderBundle . getShaderManager ( ) ) ; captureCenterEye ( renderTarget , true ) ; capture3DScreenShot ( renderTarget , true ) ; renderTarget . render ( mMainScene , left_camera , mRenderBundle . getShaderManager ( ) , mRenderBundle . getPostEffectRenderTextureA ( ) , mRenderBundle . getPostEffectRenderTextureB ( ) ) ; captureRightEye ( renderTarget , true ) ; captureLeftEye ( renderTarget , true ) ; captureFinish ( ) ; if ( DEBUG_STATS ) { mTracerDrawEyes1 . leave ( ) ; mTracerDrawEyes2 . leave ( ) ; } } else { if ( eye == 1 ) { if ( DEBUG_STATS ) { mTracerDrawEyes1 . enter ( ) ; } GVRCamera rightCamera = mainCameraRig . getRightCamera ( ) ; GVRRenderTarget renderTarget = mRenderBundle . getRenderTarget ( EYE . RIGHT , swapChainIndex ) ; renderTarget . render ( mMainScene , rightCamera , mRenderBundle . getShaderManager ( ) , mRenderBundle . getPostEffectRenderTextureA ( ) , mRenderBundle . getPostEffectRenderTextureB ( ) ) ; captureRightEye ( renderTarget , false ) ; captureFinish ( ) ; if ( DEBUG_STATS ) { mTracerDrawEyes1 . leave ( ) ; mTracerDrawEyes . leave ( ) ; } } else { if ( DEBUG_STATS ) { mTracerDrawEyes1 . leave ( ) ; mTracerDrawEyes . leave ( ) ; } GVRRenderTarget renderTarget = mRenderBundle . getRenderTarget ( EYE . LEFT , swapChainIndex ) ; GVRCamera leftCamera = mainCameraRig . getLeftCamera ( ) ; capture3DScreenShot ( renderTarget , false ) ; renderTarget . cullFromCamera ( mMainScene , mainCameraRig . getCenterCamera ( ) , mRenderBundle . getShaderManager ( ) ) ; captureCenterEye ( renderTarget , false ) ; renderTarget . render ( mMainScene , leftCamera , mRenderBundle . getShaderManager ( ) , mRenderBundle . getPostEffectRenderTextureA ( ) , mRenderBundle . getPostEffectRenderTextureB ( ) ) ; captureLeftEye ( renderTarget , false ) ; if ( DEBUG_STATS ) { mTracerDrawEyes2 . leave ( ) ; } } } } }
Called from the native side