예제 #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;
        }
예제 #2
0
    public void VignetteEffect(float level)
    {
        VignetteModel.Settings settings = postProcessingProfile.vignette.settings;

        settings.intensity = level;
        postProcessingProfile.vignette.settings = settings;
    }
예제 #3
0
    //bool isMenuOpen = false;

    private void Start()
    {
        InitializeButtons();
        InitializeSliders();
        //postProcessingProfile.vignette.enabled = true;
        vignetteSettings = MultiplayerGameManager.instance.playerPostProcessing.profile.vignette.settings;
    }
예제 #4
0
 // Update is called once per frame
 void Update()
 {
     // Linearly update all post processing values which aren't at their target values.
     lerp += Time.deltaTime / duration;
     VignetteModel.Settings vignette = profile.vignette.settings;
     if (vignette.intensity != targetVignette)
     {
         vignette.intensity = Mathf.Lerp(fromVignette, targetVignette, lerp);
     }
     DepthOfFieldModel.Settings dof = profile.depthOfField.settings;
     if (dof.aperture != targetDof)
     {
         dof.aperture = Mathf.Lerp(fromDof, targetDof, lerp);
     }
     ColorGradingModel.Settings cgm = profile.colorGrading.settings;
     if (cgm.basic.saturation != targetSaturation)
     {
         cgm.basic.saturation = Mathf.Lerp(fromSaturation, targetSaturation, lerp);
     }
     if (cgm.basic.temperature != targetTemp)
     {
         cgm.basic.temperature = Mathf.Lerp(fromTemp, targetTemp, lerp);
     }
     profile.vignette.settings     = vignette;
     profile.depthOfField.settings = dof;
     profile.colorGrading.settings = cgm;
 }
예제 #5
0
    public void UpdatePostProcesing(bool[] p_drunkEffects)
    {
        if (p_drunkEffects[(int)Player.DRUNK_EFFECTS.VIGNETTE])
        {
            m_drunkPostProcessingProfile.vignette.enabled = true;
            VignetteModel.Settings vignetteSettings = m_drunkPostProcessingProfile.vignette.settings;
            //MOAR MAGIC HERE
            vignetteSettings.intensity = m_vignetteIntensityDiff * Mathf.Sin(Time.timeSinceLevelLoad * m_vignettePacing) + (m_minVignetteIntensity + m_vignetteIntensityDiff / 2.0f);
            m_drunkPostProcessingProfile.vignette.settings = vignetteSettings;
        }
        else
        {
            m_drunkPostProcessingProfile.vignette.enabled = false;
        }

        if (p_drunkEffects[(int)Player.DRUNK_EFFECTS.DOF])
        {
            m_drunkPostProcessingProfile.depthOfField.enabled = true;
            DepthOfFieldModel.Settings DOFSettings = m_drunkPostProcessingProfile.depthOfField.settings;
            //MOAR MAGIC HERE
            DOFSettings.focusDistance = m_DOFDistanceDiff * Mathf.Sin(Time.timeSinceLevelLoad * m_vignettePacing) + (m_minDOFDistance + m_DOFDistanceDiff / 2.0f);
            m_drunkPostProcessingProfile.depthOfField.settings = DOFSettings;
        }
        else
        {
            m_drunkPostProcessingProfile.depthOfField.enabled = false;
        }
    }
예제 #6
0
    public void Start()
    {
        player = GameObject.FindGameObjectWithTag("Player").transform;
        _mover = player.GetComponent <Mover>();
        _mover.Init();
        _detector = player.GetComponent <Detector>();
        _detector.Init(this);
        _recorder = player.GetComponent <RecorderAlt>();
        _recorder.Init();

        _successSound = GetComponent <AudioSource>();

        startDoors  = GameObject.FindGameObjectsWithTag("StartDoor");
        startPicker = InitPickArray(startDoors.Length);

        endDoors  = GameObject.FindGameObjectsWithTag("EndDoor");
        endPicker = InitPickArray(endDoors.Length);

        foreach (GameObject door in endDoors)
        {
            door.GetComponent <EndDoorTrigger>().Init(this);
        }

        startDoor = startDoors[PickNew(ref startPicker)].transform;
        endDoor   = endDoors[PickNew(ref endPicker)].transform;

        //SetupNewEndDoor();

        vignetteSettings = ppProfile.vignette.settings;
        SetViewOpacity(1);
        StartCoroutine(Fade(FadeType.IN));

        //Advance();
    }
예제 #7
0
        void PreparePostProcess()
        {
            postProcess.profile.colorGrading.enabled = false;

            VignetteModel.Settings vignet = postProcess.profile.vignette.settings;
            vignet.center     = new Vector2(0.5f, 0.5f);
            vignet.intensity  = 0.45f;
            vignet.smoothness = 0.3f;
            vignet.color      = Color.black;

            BloomModel.Settings bloomSettings = postProcess.profile.bloom.settings;
            bloomSettings.bloom.intensity = 1f;
            bloomSettings.bloom.radius    = 6.06f;
            bloomSettings.bloom.softKnee  = 0.654f;


            postProcess.profile.vignette.settings = vignet;
            postProcess.profile.bloom.settings    = bloomSettings;


            //VERY QUESTIONABLE CHANGE BUT WHAT CAN YOU DO
            if (QualitySettings.pixelLightCount < optimalPixelLightAmount)
            {
                QualitySettings.pixelLightCount = optimalPixelLightAmount;
            }
        }
예제 #8
0
 // Use this for initialization
 void Start()
 {
     //oldPos = transform.position;
     vignetteSettings = ppProfile.vignette.settings;
     //fovLimiter = GetComponent<VignetteAndChromaticAberration>();
     Debug.Log("Starting intensity: " + vignetteSettings.intensity);
 }
예제 #9
0
 public void SetVignetteIntensity(float targetIntensity)
 {
     this._currentIntensity = Mathf.Lerp(this._currentIntensity, targetIntensity, this.Smoothness);
     VignetteModel.Settings settings = this._vignetteModel.settings;
     settings.intensity           = this._currentIntensity;
     this._vignetteModel.settings = settings;
 }
예제 #10
0
    private void Update()
    {
        VignetteSettings            = PPProfile.vignette.settings;
        VignetteSettings.intensity += Time.deltaTime / 5;

        PPProfile.vignette.settings = VignetteSettings;
    }
예제 #11
0
    void LightSet()
    {
        switch (m_Light)
        {
        case Light.Dark:
            colorGrad = ppProfile.colorGrading.settings;
            colorGrad.basic.postExposure    = Mathf.Lerp(colorGrad.basic.postExposure, lightIntensity.x, 2 * Time.deltaTime);
            ppProfile.colorGrading.settings = colorGrad;

            vignetteSet                 = ppProfile.vignette.settings;
            vignetteSet.intensity       = Mathf.Lerp(vignetteSet.intensity, vignetteIntensity.x, 2 * Time.deltaTime);
            ppProfile.vignette.settings = vignetteSet;
            break;

        case Light.Lantern:
            colorGrad = ppProfile.colorGrading.settings;
            colorGrad.basic.postExposure    = Mathf.Lerp(colorGrad.basic.postExposure, lightIntensity.y, 2 * Time.deltaTime);
            ppProfile.colorGrading.settings = colorGrad;

            vignetteSet                 = ppProfile.vignette.settings;
            vignetteSet.intensity       = Mathf.Lerp(vignetteSet.intensity, vignetteIntensity.y, 2 * Time.deltaTime);
            ppProfile.vignette.settings = vignetteSet;
            break;

        case Light.Lamp:
            colorGrad = ppProfile.colorGrading.settings;
            colorGrad.basic.postExposure    = Mathf.Lerp(colorGrad.basic.postExposure, lightIntensity.z, 2 * Time.deltaTime);
            ppProfile.colorGrading.settings = colorGrad;

            vignetteSet                 = ppProfile.vignette.settings;
            vignetteSet.intensity       = Mathf.Lerp(vignetteSet.intensity, vignetteIntensity.z, 2 * Time.deltaTime);
            ppProfile.vignette.settings = vignetteSet;
            break;
        }
    }
예제 #12
0
 // Update is called once per frame
 void Update()
 {
     if (_canInteract)
     {
         if (Input.GetKeyDown(KeyCode.UpArrow))
         {
             if (exterior.activeSelf)
             {
                 exterior.SetActive(false);
                 interior.SetActive(true);
                 var t = new VignetteModel.Settings();
                 t           = GameObject.FindObjectOfType <PostProcessingBehaviour> ().profile.vignette.settings;
                 t.intensity = 0.6f;
                 GameObject.FindObjectOfType <PostProcessingBehaviour> ().profile.vignette.settings = t;
             }
             else
             {
                 //0.46
                 var t = new VignetteModel.Settings();
                 t           = GameObject.FindObjectOfType <PostProcessingBehaviour> ().profile.vignette.settings;
                 t.intensity = 0.46f;
                 GameObject.FindObjectOfType <PostProcessingBehaviour> ().profile.vignette.settings = t;
                 exterior.SetActive(true);
                 interior.SetActive(false);
             }
         }
     }
 }
예제 #13
0
    IEnumerator ShowEndingTrainSceneCoroutine()
    {
        iTween.FadeTo(m_CameraFadePanel, 1f, m_CameraFadeDuration + 3.5f);
        m_PlayerSpeechBubble.SetActive(false);
        yield return(new WaitForSeconds(m_CameraFadeDuration + 4f));

        VignetteModel.Settings vignetteSettings = m_PostProcessingProfile.vignette.settings;
        vignetteSettings.intensity = 0f;
        m_PostProcessingProfile.vignette.settings = vignetteSettings;

        GrainModel grainModel = m_PostProcessingProfile.grain;

        grainModel.enabled = true;

        DepthOfFieldModel dofModel = m_PostProcessingProfile.depthOfField;

        dofModel.enabled = true;

        m_GirlfriendMeetingPanel.SetActive(false);
        m_EndingPanel.SetActive(true);
        m_BGMPlayer.PlayEndingSong();

        iTween.FadeTo(m_CameraFadePanel, 0f, m_CameraFadeDuration + 2f);
        yield return(new WaitForSeconds(m_CameraFadeDuration + 4f));

        //m_CinematicScript.ShowNextButton (MoveToCredits);
        yield return(new WaitForSeconds(3f));

        yield return(ShowCreditsCoroutine());
    }
    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);
        }
    }
예제 #15
0
    //This method will be called every frame while the damage visual effect is active
    void ProcessDamageEffect()
    {
        //Record the ellapsed time and calculate the percentage of the effect that is complete
        elapsedTime += Time.deltaTime;
        float percentage = elapsedTime / damageEffectDuration;

        //Grab the current vignette settings...
        VignetteModel.Settings vignette = profile.vignette.settings;
        //...Lerp the color value...
        vignette.color = Color.Lerp(damageProfile.vignette.settings.color, Color.white, percentage);
        //...and then apply the Lerped changes
        profile.vignette.settings = vignette;

        //Grab the current aberration settings...
        ChromaticAberrationModel.Settings chroma = profile.chromaticAberration.settings;
        //...Lerp the intensity...
        chroma.intensity = Mathf.Lerp(damageProfile.chromaticAberration.settings.intensity, 0f, percentage);
        //... and then apply the Lerped changes
        profile.chromaticAberration.settings = chroma;

        //If the time has reached 100% stop the effect
        if (percentage >= 1f)
        {
            StopDamageEffect();
        }
    }
    public void AtualizaPerfil()
    {
        float intensidadeGrain    = 0.18f;
        float intensidadeVignette = 0.4f;
        float temperatura         = -5f;
        float difSaturacao        = 0.64f;
        float difContraste        = 0.3f;

        GrainModel.Settings grainSettings = perfil.grain.settings;
        grainSettings.intensity = intensidadeGrain * intensidade;
        perfil.grain.settings   = grainSettings;

        VignetteModel.Settings vignetteSettings = perfil.vignette.settings;
        vignetteSettings.intensity = intensidadeVignette * intensidade;
        perfil.vignette.settings   = vignetteSettings;

        ColorGradingModel.Settings colorGradingSettings = perfil.colorGrading.settings;
        colorGradingSettings.basic.temperature     = temperatura * intensidade;
        colorGradingSettings.basic.saturation      = 1 - difSaturacao * intensidade;
        colorGradingSettings.basic.contrast        = 1 - difContraste * intensidade;
        colorGradingSettings.colorWheels.log.slope = new Color(1 - 0.183f * intensidade, 1 - 0.152f * intensidade, 1f, 0f);
        colorGradingSettings.colorWheels.log.power = new Color(1 - 0.35f * intensidade, 1 - 0.284f * intensidade, 1f, 0f);

        perfil.colorGrading.settings = colorGradingSettings;
    }
예제 #17
0
    void Start()
    {
        vignetteSettings           = _CC.vignette.settings;
        vignetteSettings.intensity = 0;

        anim = GetComponent <Animator>();
    }
예제 #18
0
    public void SetInitialPostProcess(PostProcessType pType, float value)
    {
        switch (pType)
        {
        case PostProcessType.vignette:
            VignetteModel.Settings confv = profile.vignette.settings;
            confv.intensity           = value;
            profile.vignette.settings = confv;
            break;

        case PostProcessType.blackout:
            ColorGradingModel.Settings confg = profile.colorGrading.settings;
            confg.tonemapping.neutralBlackOut = value;
            profile.colorGrading.settings     = confg;
            break;

        case PostProcessType.chromatic:
            ChromaticAberrationModel.Settings confc = profile.chromaticAberration.settings;
            confc.intensity = value;
            profile.chromaticAberration.settings = confc;
            break;

        case PostProcessType.grain:
            GrainModel.Settings confgr = profile.grain.settings;
            confgr.intensity       = value;
            profile.grain.settings = confgr;
            break;
        }
    }
예제 #19
0
 //Set start values again & Start Intro Vignette Reduction
 void Start()
 {
     _profile.vignette.enabled = true;
     VignetteModel.Settings viSettings = _profile.vignette.settings;
     viSettings.intensity       = 1f;
     _profile.vignette.settings = viSettings;
     IntroVignetteReduction();
 }
예제 #20
0
 public void Initialize()
 {
     GameController.MainCamera.orthographicSize = sizeMin;
     chromaticFx = effectStackProfile.chromaticAberration.settings;
     vigneteFx   = effectStackProfile.vignette.settings;
     bloomFx     = effectStackProfile.bloom.settings;
     UpdateFX();
 }
예제 #21
0
    // Use this for initialization
    void Start()
    {
        ballManagerScript = BallManager.GetComponent <BallManager>();

        VignetteModel.Settings vignetteSettings = ppProfile.vignette.settings;
        vignetteSettings.intensity  = 0;
        ppProfile.vignette.settings = vignetteSettings;
    }
예제 #22
0
    private void Start()
    {
        _postProcessingBehaviour = GetComponent <PostProcessingBehaviour>();
        _postProcessingProfile   = _postProcessingBehaviour.profile;
        _vignetteSettings        = _postProcessingProfile.vignette.settings;

        UpdateEnd(0f);
        DoctorControl.Instance.OnPlayerStabbed += Instance_OnPlayerStabbed;
    }
    void Update()
    {
        VignetteModel.Settings vignette = redVignette.profile.vignette.settings;
        float val = curve.Evaluate(Time.time);

        vignette.intensity = val;

        redVignette.profile.vignette.settings = vignette;
    }
예제 #24
0
    void Start()
    {
        ppProfile = GetComponent <PostProcessingBehaviour>().profile;

        m_Vignette           = ppProfile.vignette.settings;
        m_Vignette.intensity = 1f;

        m_Bloom.bloom.radius = 5;
    }
예제 #25
0
    // Update is called once per frame
    void Update()
    {
        // if (ballManagerScript.correctBallCount % ballManagerScript.ballsToIncreaseDifficulty == 0 && ballManagerScript.correctBallCount != 0)
        //  {
        VignetteModel.Settings vignetteSettings = ppProfile.vignette.settings;
        vignetteSettings.intensity = ballManagerScript.correctBallCount / 50;

        ppProfile.vignette.settings = vignetteSettings;
        //}
    }
예제 #26
0
    private void Start()
    {
        Canvas = GameObject.Find("Canvas").GetComponent <Animator>();

        VignetteSettings           = PPProfile.vignette.settings;
        VignetteSettings.intensity = 0;

        PPProfile.vignette.settings = VignetteSettings;
        StartCoroutine(FadeTimer());
    }
예제 #27
0
    void Start()
    {
        profile          = Camera.main.GetComponent <PostProcessingBehaviour>().profile;
        bloomSettings    = profile.bloom.settings;
        vignetteSettings = profile.vignette.settings;
        grainSettings    = profile.grain.settings;

        ResetGrain();
        ResetVignette();
    }
예제 #28
0
    void Start()
    {
        vignette           = postProcessing.vignette.settings;
        currentLanternUses = startingLanternUses;

        vignette.intensity = 1.0f;
        postProcessing.vignette.settings = vignette;

        rb       = GetComponent <Rigidbody>();
        collider = GetComponent <SphereCollider>();
    }
    private Color m_BlockEndColor   = new Color(0, 0, 0, 1); //The camera block end color


    // Use this for initialization
    void Start()
    {
        fpc = this.gameObject.GetComponent <FirstPersonController>();

        m_CameraImage = m_CameraBlock.GetComponent <Image>();

        m_ppProfile      = this.GetComponentInChildren <PostProcessingBehaviour>().profile;
        vignetteSettings = m_ppProfile.vignette.settings;

        m_StartLocation = this.transform.localPosition;
    }
예제 #30
0
    private IEnumerator <float> _LerpVignetteColor(VignetteModel.Settings settings, Color col, float dur)
    {
        Color startCol = settings.color;

        for (float t = 0f; t < 1f; t += Timing.DeltaTime / dur)
        {
            settings.color = Color.Lerp(startCol, col, t);
            yield return(Timing.WaitForOneFrame);
        }
        settings.color = col;
    }