Exemple #1
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyUp(KeyCode.Return))
     {
         Time.timeScale = Time.timeScale > 0.0f ? 0.0f : 1.0f;
     }
     else if (Input.GetKeyUp(KeyCode.M))
     {
         if (m_VRWorks.IsFeatureAvailable(NVIDIA.VRWorks.Feature.MultiResolution))
         {
             if (m_VRWorks.GetActiveFeature() != NVIDIA.VRWorks.Feature.MultiResolution)
             {
                 m_VRWorks.SetActiveFeature(NVIDIA.VRWorks.Feature.MultiResolution);
             }
             else
             {
                 m_VRWorks.SetActiveFeature(NVIDIA.VRWorks.Feature.None);
             }
         }
     }
 }
Exemple #2
0
    void CustomGraphicsBlit(RenderTexture source, RenderTexture dest, Material fxMaterial, int passNr)
    {
        RenderTexture.active = dest;

        fxMaterial.SetTexture("_MainTex", source);

        if (m_VRWorks.GetActiveFeature() != NVIDIA.VRWorks.Feature.None)
        {
            NVIDIA.VRWorks.FeatureData data = m_VRWorks.GetActiveFeatureData();
            GL.Viewport(new Rect(0, 0, data.boundingRect[2] - data.boundingRect[0], data.boundingRect[3] - data.boundingRect[1]));
        }

        GL.PushMatrix();
        GL.LoadOrtho();

        fxMaterial.SetPass(passNr);

        GL.Begin(GL.QUADS);

        GL.MultiTexCoord2(0, 0.0f, 0.0f);
        GL.Vertex3(0.0f, 0.0f, 3.0f);          // BL

        GL.MultiTexCoord2(0, 1.0f, 0.0f);
        GL.Vertex3(1.0f, 0.0f, 2.0f);          // BR

        GL.MultiTexCoord2(0, 1.0f, 1.0f);
        GL.Vertex3(1.0f, 1.0f, 1.0f);          // TR

        GL.MultiTexCoord2(0, 0.0f, 1.0f);
        GL.Vertex3(0.0f, 1.0f, 0.0f);          // TL

        GL.End();
        GL.PopMatrix();

        if (m_VRWorks.GetActiveFeature() != NVIDIA.VRWorks.Feature.None)
        {
            GL.Viewport(new Rect(0, 0, dest.width, dest.height));
        }
    }