protected void captureCenterEye ( GVRRenderTarget renderTarget , boolean isMultiview ) { if ( mScreenshotCenterCallback == null ) { return ; } // TODO: when we will use multithreading, create new camera using centercamera as we are adding posteffects into it final GVRCamera centerCamera = mMainScene . getMainCameraRig ( ) . getCenterCamera ( ) ; final GVRMaterial postEffect = new GVRMaterial ( this , GVRMaterial . GVRShaderType . VerticalFlip . ID ) ; centerCamera . addPostEffect ( postEffect ) ; GVRRenderTexture posteffectRenderTextureB = null ; GVRRenderTexture posteffectRenderTextureA = null ; if ( isMultiview ) { posteffectRenderTextureA = mRenderBundle . getEyeCapturePostEffectRenderTextureA ( ) ; posteffectRenderTextureB = mRenderBundle . getEyeCapturePostEffectRenderTextureB ( ) ; renderTarget = mRenderBundle . getEyeCaptureRenderTarget ( ) ; renderTarget . cullFromCamera ( mMainScene , centerCamera , mRenderBundle . getShaderManager ( ) ) ; renderTarget . beginRendering ( centerCamera ) ; } else { posteffectRenderTextureA = mRenderBundle . getPostEffectRenderTextureA ( ) ; posteffectRenderTextureB = mRenderBundle . getPostEffectRenderTextureB ( ) ; } renderTarget . render ( mMainScene , centerCamera , mRenderBundle . getShaderManager ( ) , posteffectRenderTextureA , posteffectRenderTextureB ) ; centerCamera . removePostEffect ( postEffect ) ; readRenderResult ( renderTarget , EYE . MULTIVIEW , false ) ; if ( isMultiview ) renderTarget . endRendering ( ) ; final Bitmap bitmap = Bitmap . createBitmap ( mReadbackBufferWidth , mReadbackBufferHeight , Bitmap . Config . ARGB_8888 ) ; mReadbackBuffer . rewind ( ) ; bitmap . copyPixelsFromBuffer ( mReadbackBuffer ) ; final GVRScreenshotCallback callback = mScreenshotCenterCallback ; Threads . spawn ( new Runnable ( ) { public void run ( ) { callback . onScreenCaptured ( bitmap ) ; } } ) ; mScreenshotCenterCallback = null ; }
capture center eye