private void UpdateSdanrdardCB()
        {
            // fix for VR black screen
            Material_current.SetOverrideTag("RenderType", "Opaque");
            Material_current.SetInt("_SrcBlend", (int)BlendMode.One);
            Material_current.SetInt("_DstBlend", (int)BlendMode.Zero);
            Material_current.SetInt("_ZWrite", 1);
            Material_current.renderQueue = -1;

#if UNITY_2017_2_OR_NEWER
            Material_current.SetFloat("_ResizeWidth", UnityEngine.XR.XRSettings.eyeTextureWidth);
            Material_current.SetFloat("_ResizeHeight", UnityEngine.XR.XRSettings.eyeTextureHeight);
#else
            Material_current.SetFloat("_ResizeWidth", UnityEngine.VR.VRSettings.eyeTextureWidth);
            Material_current.SetFloat("_ResizeHeight", UnityEngine.VR.VRSettings.eyeTextureHeight);
#endif
            Material_current.SetFloat("_Sharpness", sharpness);
            Material_current.SetFloat("_SampleDistance", sampleDistance);

            FXAA_FSS_Mat.SetVector("_QualitySettings", new Vector3(1.0f, 0.063f, 0.0312f));
            FXAA_FSS_Mat.SetVector("_ConsoleSettings", new Vector4(0.5f, 2.0f, 0.125f, 0.04f));
            FXAA_FSS_Mat.SetFloat("_Intensity", fssaaIntensity);

            //Debug.Log(Material_current.shader.name);
        }
Example #2
0
 private void UpdateCB()
 {
     Material_current.SetFloat("_ResizeWidth", Screen.width);
     Material_current.SetFloat("_ResizeHeight", Screen.height);
     Material_current.SetFloat("_Sharpness", Sharpness);
     Material_current.SetFloat("_SampleDistance", SampleDistance);
     if (Screen.width != baseRt.width || Screen.height != baseRt.height)
     {
         baseRt.Release();
         baseRt.width  = Screen.width;
         baseRt.height = Screen.height;
         baseRt.Create();
     }
 }
Example #3
0
        private void UpdateSdanrdardCB()
        {
#if UNITY_2017_2_OR_NEWER
            Material_current.SetFloat("_ResizeWidth", UnityEngine.XR.XRSettings.eyeTextureWidth);
            Material_current.SetFloat("_ResizeHeight", UnityEngine.XR.XRSettings.eyeTextureHeight);
#else
            Material_current.SetFloat("_ResizeWidth", UnityEngine.VR.VRSettings.eyeTextureWidth);
            Material_current.SetFloat("_ResizeHeight", UnityEngine.VR.VRSettings.eyeTextureHeight);
#endif
            Material_current.SetFloat("_Sharpness", sharpness);
            Material_current.SetFloat("_SampleDistance", sampleDistance);

            FXAA_FSS_Mat.SetVector("_QualitySettings", new Vector3(1.0f, 0.063f, 0.0312f));
            FXAA_FSS_Mat.SetVector("_ConsoleSettings", new Vector4(0.5f, 2.0f, 0.125f, 0.04f));
            FXAA_FSS_Mat.SetFloat("_Intensity", fssaaIntensity);

            //Debug.Log(Material_current.shader.name);
        }