Exemplo n.º 1
0
        private void OnGUI()
        {
            if (m_VRWorks == null)
            {
                m_VRWorks = Camera.main.GetComponent <NVIDIA.VRWorks>();
            }
            string mode = "None";

            NVIDIA.VRWorks.Feature feature = m_VRWorks.GetActiveFeature();
            if (feature == NVIDIA.VRWorks.Feature.LensMatchedShading)
            {
                mode = "SPS + LMS";
            }
            else if (feature == NVIDIA.VRWorks.Feature.SinglePassStereo)
            {
                mode = "SPS";
            }
            else if (feature == NVIDIA.VRWorks.Feature.MultiResolution)
            {
                mode = "MRS";
            }
            GUI.Label(new Rect(10, 10, 300, 30), "VRWorks: " + mode, m_GUIStyle);
        }
Exemplo n.º 2
0
 // Called by camera to apply image effect
 void OnRenderImage(RenderTexture source, RenderTexture destination)
 {
     NVIDIA.VRWorks.Feature feature = m_VRWorks.GetActiveFeature();
     if (feature == NVIDIA.VRWorks.Feature.LensMatchedShading || feature == NVIDIA.VRWorks.Feature.MultiResolution)
     {
         UnityEngine.Rendering.CommandBuffer buf = new UnityEngine.Rendering.CommandBuffer();
         buf.SetRenderTarget(destination);
         buf.IssuePluginCustomBlit(PluginExtGetIssueEventCallback(), kPluginExtCommandUpscale, source, destination, 0, VerticalFlip ? 1U : 0U);
         Graphics.ExecuteCommandBuffer(buf);
     }
     else
     {
         Graphics.Blit(source, destination);
     }
 }