Exemple #1
0
        void OnPostRenderListener(int cacheTextureId, NxrViewer.Eye eyeType)
        {
            if (NxrGlobal.isVR9Platform)
            {
                if (eyeType == NxrViewer.Eye.Right && Application.isMobilePlatform)
                {
                    if (NxrGlobal.DEBUG_LOG_ENABLED)
                    {
                        Debug.Log("OnPostRenderListener.PrepareFrame.Right");
                    }
                    NxrPluginEvent.Issue(NibiruRenderEventType.PrepareFrame);
                }
                return;
            }

            if (NxrViewer.USE_DTR && NxrGlobal.supportDtr)
            {
                // 左右眼绘制结束
                NibiruRenderEventType eventType = eyeType == NxrViewer.Eye.Left ? NibiruRenderEventType.LeftEyeEndFrame : NibiruRenderEventType.RightEyeEndFrame;
                // 左右眼绘制结束事件
                // int eyeTextureId = (int)cam.targetTexture.GetNativeTexturePtr();
                NxrPluginEvent.IssueWithData(eventType, cacheTextureId);
                if (NxrGlobal.DEBUG_LOG_ENABLED)
                {
                    Debug.Log("OnPostRender.eye[" + eyeType + "]");
                }
            }

            if (NxrViewer.USE_DTR && eyeType == NxrViewer.Eye.Right)
            {
                // NxrViewer.Instance.EnterXRMode();
            }
        }
Exemple #2
0
 void OnPreRenderListener(int cacheTextureId, NxrViewer.Eye eyeType)
 {
     if (NxrGlobal.isVR9Platform)
     {
         return;
     }
     if (NxrViewer.USE_DTR && NxrGlobal.supportDtr)
     {
         // 左右眼绘制开始
         NibiruRenderEventType eventType = eyeType == NxrViewer.Eye.Left ? NibiruRenderEventType.LeftEyeBeginFrame : NibiruRenderEventType.RightEyeBeginFrame;
         NxrPluginEvent.IssueWithData(eventType, cacheTextureId);
         if (NxrGlobal.DEBUG_LOG_ENABLED)
         {
             Debug.Log("OnPreRender.eye[" + eyeType + "]");
         }
     }
 }