Example #1
0
        private void Update()
        {
            VignetteModel vignettePost = postProcessing.m_Vignette.model;

            if (vignettePost == null || !VRConfig.configUseVignetteWhenMoving.Value)
            {
                return;
            }

            targetIntensity = GetVignetteIntensityForVelocityPerGamestate();

            VignetteModel.Settings newSettings = vignettePost.settings;


            // Lerp to vignette intensity. Ramp up faster and ramp down slower.
            if (newSettings.intensity <= targetIntensity)
            {
                newSettings.intensity = Mathf.Lerp(vignettePost.settings.intensity, targetIntensity, 20f * Time.deltaTime);
            }
            else
            {
                newSettings.intensity = Mathf.Lerp(vignettePost.settings.intensity, targetIntensity, 8f * Time.deltaTime);
            }

            vignettePost.settings = newSettings;
        }
    private IEnumerator LerpCR()
    {
        GetComponent <CameraFollow>().FocusOnPlayer();
        float currentTime = 0f;

        while (currentTime < duration)
        {
            VignetteModel          vignet      = ppp.vignette;
            VignetteModel.Settings newVignette = vignet.settings;

            newVignette.intensity  = Mathf.Lerp(1f, 0f, currentTime / duration);
            newVignette.smoothness = Mathf.Lerp(1f, 0f, currentTime / duration);

            vignet.settings = newVignette;

            GrainModel          grain    = ppp.grain;
            GrainModel.Settings newGrain = grain.settings;

            newGrain.intensity             = Mathf.Lerp(1f, 0f, currentTime / duration);
            newGrain.size                  = Mathf.Lerp(3f, 1f, currentTime / duration);
            newGrain.luminanceContribution = Mathf.Lerp(0f, 1f, currentTime / duration);

            grain.settings = newGrain;

            currentTime += Time.deltaTime;
            yield return(null);
        }
    }
Example #3
0
    private void Start()
    {
        prevFrameDrunkLvl = drunkValToDrunkLvl(flowchart.GetIntegerVariable("drunkLvl"));
        blur = mainCamera.GetComponent <BlurOptimized>();

        var postProcessingBehaviour = mainCamera.GetComponent <PostProcessingBehaviour>();

        chromaticAberration         = postProcessingBehaviour.profile.chromaticAberration;
        chromaticAberration.enabled = false;
        SetChromaticAberrationIntensity(0f);

        vignette         = postProcessingBehaviour.profile.vignette;
        vignette.enabled = false;
        SetVignetteIntensity(0f);
        var s = vignette.settings;

        s.smoothness      = defaultVignetteSmoothness;
        s.roundness       = defaultVignetteRoundness;
        vignette.settings = s;

        if (girl != null)
        {
            girl.key = "plump";
        }
    }
    IEnumerator save_Vignette()
    {
        yield return(new WaitForEndOfFrame());

        for (int a = 0; a < pb.Length; a++)
        {
            VignetteModel m = pb [a].profile.vignette;

            if (vignette.value == 0)
            {
                m.enabled = false;
                PlayerPrefs.SetString("Vignette", "Off");
            }
            if (vignette.value == 1)
            {
                m.enabled = true;
                PlayerPrefs.SetString("Vignette", "On");
            }

            pb [a].profile.vignette = m;
        }
    }
 private void Start()
 {
     vignette          = GetComponent <PostProcessingBehaviour>().profile.vignette;
     startingIntensity = vignette.settings.intensity;
 }
Example #6
0
 // Use this for initialization
 void Start()
 {
     vModel = postProcess.profile.vignette;
     maxFOV = Mathf.Rad2Deg * Mathf.Atan2(IPD / 2f, SCREEN_DISTANCE);
 }