예제 #1
0
    //string mFileName = Application.persistentDataPath + "/d" + i + "-ScreenShot.png";
    //Debug.Log(mFileName);
    //!System.IO.File.Exists(mFileName)

    //Texture2D mTexture = NvrViewer.Instance.createTexture2D(re);
    //Debug.Log(mFileName);
    ////将图片信息编码为字节信息
    //byte[] bytes = mTexture.EncodeToPNG();
    //// 保存
    //System.IO.File.WriteAllBytes(mFileName, bytes);


    IEnumerator EndOfFrame()
    {
        while (true)
        {
            yield return(new WaitForEndOfFrame());

            if (NvrViewer.USE_DTR && NvrGlobal.supportDtr)
            {
                NvrPluginEvent.IssueWithData(RenderEventType.TimeWarp, NvrViewer.Instance.GetTimeWarpViewNum());
            }
        }
    }
    void OnPostRender()
    {
        if (NvrViewer.USE_DTR && NvrGlobal.supportDtr)
        {
            // 左右眼绘制结束
            RenderEventType eventType = eye == NvrViewer.Eye.Left ?  RenderEventType.LeftEyeEndFrame :  RenderEventType.RightEyeEndFrame;
            // 左右眼绘制结束事件
            // int eyeTextureId = (int)cam.targetTexture.GetNativeTexturePtr();
            if (cacheTextureId == -1)
            {
                cacheTextureId = (int)cam.targetTexture.GetNativeTexturePtr();
            }
            NvrPluginEvent.IssueWithData(eventType, cacheTextureId);
        }

        if (NvrViewer.USE_DTR)
        {
            NvrViewer.Instance.EnterVRMode();
        }

        Shader.DisableKeyword("NVR_DISTORTION");
    }