void Start() { // haveKey = false; chromaticLayer = ScriptableObject.CreateInstance <ChromaticAberration>(); lensLayer = ScriptableObject.CreateInstance <LensDistortion>(); depthLayer = ScriptableObject.CreateInstance <DepthOfField>(); postProcess = post.GetComponent <PostProcessVolume>(); audio = GetComponent <AudioSource>(); FearBar = FearBarObject.GetComponent <Slider>(); LiferBar = LifeBarObject.GetComponent <Slider>(); persecution = false; depthLayer.active = false; postProcess.profile.TryGetSettings(out chromaticLayer); postProcess.profile.TryGetSettings(out lensLayer); postProcess.profile.TryGetSettings(out depthLayer); contador = 0; isDead = false; life = 100; fear = 0; temp = 0; temp2 = 0; }
void Start() { #region BlurVision BlurOfVision = ScriptableObject.CreateInstance <DepthOfField>(); BlurOfVision.enabled.Override(true); BlurOfVision.focusDistance.overrideState = true; #endregion #region LensD LensD = ScriptableObject.CreateInstance <LensDistortion>(); LensD.enabled.Override(true); LensD.intensity.overrideState = true; #endregion #region ColorG ColorG = ScriptableObject.CreateInstance <ColorGrading>(); ColorG.enabled.Override(true); ColorG.saturation.overrideState = true; #endregion #region TVig TVig = ScriptableObject.CreateInstance <Vignette>(); TVig.enabled.Override(true); TVig.intensity.overrideState = true; #endregion Volume = PostProcessManager.instance.QuickVolume(gameObject.layer, 100f, BlurOfVision, LensD, ColorG, TVig); }
private IEnumerator SickCoroutine() { LensDistortion lensDistortion = PostProcessing.CurrentFilter.GetSetting <LensDistortion>(); lensDistortion.enabled.Override(true); while (true) { for (float i = -1; i < 1; i += 0.01f) { if (PostProcessing.CurrentFilter != null) { FloatParameter newValue = new FloatParameter(); newValue.value = i; lensDistortion.centerY.Override(newValue); } yield return(null); } for (float i = 1; i > -1; i -= 0.01f) { if (PostProcessing.CurrentFilter != null) { FloatParameter newValue = new FloatParameter(); newValue.value = i; lensDistortion.centerY.Override(newValue); } yield return(null); } } }
void Awake() { chromaticAberration = profile.GetSetting <ChromaticAberration>(); ambientOcclusion = profile.GetSetting <AmbientOcclusion>(); grain = profile.GetSetting <Grain>(); lensDistortion = profile.GetSetting <LensDistortion>(); }
//private float vignetteInit = 0f; private void Awake() { playerAudio = GetComponent <PlayerAudio>(); //postProcessing = FindObjectOfType<Volume>().GetComponent<Animator>(); volume = FindObjectOfType <Volume>(); if (volume.profile.TryGet <LensDistortion>(out var lens)) { distortion = lens; } if (volume.profile.TryGet <ColorAdjustments>(out var postColors)) { colors = postColors; } if (volume.profile.TryGet <ChromaticAberration>(out var chrom)) { chromatic = chrom; chromaticInit = chrom.intensity.value; } /* * if (volume.profile.TryGet<Vignette>(out var vin)) * { * vignette = vin; * vignetteInit = vin.intensity.value; * }*/ }
IEnumerator FinishRoutine(bool win) { EnableControl = false; BulletSpawner.Instance.DestroyAllBullets(); yield return(null); ResetGame(); if (win) { LensDistortion lensDistortion = null; postProcessVolume.profile.TryGetSettings(out lensDistortion); lensDistortion.intensity.value = 0f; float t = 0; while (t < 1) { t += Time.unscaledDeltaTime * 1.2f; lensDistortion.intensity.value = lensDistortionCurve.Evaluate(t) * 100; lensDistortion.scale.value = Mathf.Lerp(1, 0.5f, lensDistortionCurve.Evaluate(t)); yield return(null); } lensDistortion.intensity.value = 0f; lensDistortion.scale.value = 1; announcer.NewLevel(RoundNumber); } // //yield return new WaitForSecondsRealtime(0.5f); //Time.timeScale = 1; }
void Update() { LensDistortion lensDistortionLayer = null; volume.profile.TryGetSettings(out lensDistortionLayer); lensDistortionLayer.enabled.value = true; lensDistortionLayer.intensity.value = Mathf.Sin(Time.time) * 15f - 35f; }
private void Start() { EnableControl = false; LensDistortion lensDistortion = null; postProcessVolume.profile.TryGetSettings(out lensDistortion); lensDistortion.intensity.value = 0f; }
private void Awake() { _cpMain = transform.parent.GetComponent <CpMain>(); _caBoost = transform.parent.GetComponent <CaBoost>(); _chromaticAberration = _profile.GetSetting <ChromaticAberration>(); _lensDistortion = _profile.GetSetting <LensDistortion>(); }
void Start() { var volume = GetComponent <Volume>(); if (volume.profile.TryGet <LensDistortion>(out var ld)) { lensDistortion = ld; } }
private void Start() { LockMouse(); player = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerController>(); PostProcessVolume volume = gameObject.GetComponent <PostProcessVolume>(); distortion = volume.profile.GetSetting <LensDistortion>(); }
// Start is called before the first frame update void Start() { player_cam = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>(); default_fov = player_cam.fieldOfView; ca = profile.GetSetting <ChromaticAberration>(); ld = profile.GetSetting <LensDistortion>(); cg = profile.GetSetting <ColorGrading>(); }
// Start is called before the first frame update void Start() { _LD = PPV.profile.GetSetting <LensDistortion>(); _VIG = PPV.profile.GetSetting <Vignette>(); _CG = PPV.profile.GetSetting <ColorGrading>(); SetDistortionLevel(0); Instance = this; }
private void Awake() { ppVol = GetComponent <PostProcessVolume>(); lens = ppVol.profile.settings[0] as LensDistortion; x = new FloatParameter(); y = new FloatParameter(); x.value = lens.intensityX; y.value = lens.intensityY; audioSrc = GetComponent <AudioSource>(); }
public void SetCameraEffect() { LensDistortion lens = null; ppv.profile.TryGetSettings(out lens); DOTween.To(() => lens.intensity.value, x => lens.intensity.value = x, -15, 0.1f); var cam = brain.ActiveVirtualCamera.VirtualCameraGameObject; var col = cam.GetComponent <Cinemachine.CinemachineCollider>(); DOTween.To(() => col.m_MinimumDistanceFromTarget, x => col.m_MinimumDistanceFromTarget = x, 20, 0.1f); }
void Start() { //m_vignetteEffect = m_volumeProfile.components //m_vignetteEffect = m_volumeProfile.components.GetType(UnityEngine.Rendering.Universal.Vignette); //m_vignetteEffect = //ScriptableObject.CreateInstance<Vignette>(); m_vignetteEffect.intensity.Override(fVignetteIntensityIdle); m_vignetteEffect.color.Override(color); m_lensEffect = ScriptableObject.CreateInstance <LensDistortion>(); m_lensEffect.intensity.Override(fLensIntensityIdle); }
void CheckDistortion() { if (DistortionParameters.Count == 0) { DistortionParameters = new List <float>(new float[4]); } else if (DistortionParameters.Count != 4) { throw new Exception("Length of DistortionParameters is not 4."); } if (Fisheye && !Distorted) { throw new Exception("Distorted must be true for fisheye lens."); } if (LensDistortion == null || SizeChanged || CurrentFieldOfView != FieldOfView || CurrentDistorted != Distorted || !Enumerable.SequenceEqual(DistortionParameters, CurrentDistortionParameters) || (Fisheye && CurrentXi != Xi)) { // View frustum size at the focal plane. FrustumHeight = 2 * Mathf.Tan(FieldOfView / 2 * Mathf.Deg2Rad); FrustumWidth = FrustumHeight * Width / Height; if (LensDistortion == null) { LensDistortion = new LensDistortion(); } LensDistortion.InitDistortion(DistortionParameters, FrustumWidth, FrustumHeight, Fisheye ? Xi : 0); LensDistortion.CalculateRenderTextureSize(Width, Height, out RenderTextureWidth, out RenderTextureHeight); if (RenderTextureWidth <= 0 || RenderTextureHeight <= 0) { throw new Exception("Distortion parameters cause texture size invalid (<= 0)."); } faceMask = 0; faceMask |= 1 << (int)(CubemapFace.PositiveX); // right face faceMask |= 1 << (int)(CubemapFace.NegativeX); // left face faceMask |= 1 << (int)(CubemapFace.PositiveY); // top face faceMask |= 1 << (int)(CubemapFace.NegativeY); // bottom face faceMask |= 1 << (int)(CubemapFace.PositiveZ); // front face CurrentFieldOfView = FieldOfView; CurrentDistorted = Distorted; CurrentDistortionParameters = new List <float>(DistortionParameters); CurrentXi = Xi; } }
public override void Setup() { base.Setup(); m_LensDistortionShader = Shader.Find(k_ShaderName); var shaderVariantCollection = new ShaderVariantCollection(); if (shaderVariantCollection != null) { shaderVariantCollection.Add(new ShaderVariantCollection.ShaderVariant(m_LensDistortionShader, PassType.ScriptableRenderPipeline)); } m_LensDistortionMaterial = new Material(m_LensDistortionShader); if (shaderVariantCollection != null) { shaderVariantCollection.WarmUp(); } // Set up a new texture if (m_DistortedTexture == null || m_DistortedTexture.width != Screen.width || m_DistortedTexture.height != Screen.height) { if (m_DistortedTexture != null) { m_DistortedTexture.Release(); } m_DistortedTexture = new RenderTexture(Screen.width, Screen.height, 0, RenderTextureFormat.ARGBFloat, RenderTextureReadWrite.Linear); m_DistortedTexture.enableRandomWrite = true; m_DistortedTexture.filterMode = FilterMode.Point; m_DistortedTexture.Create(); } // Grab the lens distortion #if HDRP_PRESENT // Grab the Lens Distortion from Perception Camera stack var hdCamera = HDCamera.GetOrCreate(targetCamera); var stack = hdCamera.volumeStack; m_LensDistortion = stack.GetComponent <LensDistortion>(); #elif URP_PRESENT var stack = VolumeManager.instance.stack; m_LensDistortion = stack.GetComponent <LensDistortion>(); #endif m_Initialized = true; }
public void Start() { this.camera = Camera.main.transform.gameObject; this.rigidBody = GetComponent <Rigidbody>(); this.view = GetComponent <PhotonView>(); this.userName.text = this.view.Owner.NickName; // Get Lens distortion GameObject pp = GameObject.Find("Post Process Volume"); if (pp) { LensDistortion tmp; pp.GetComponent <Volume>().profile.TryGet <LensDistortion>(out tmp); this.lensDistortion = tmp; } }
// Start is called before the first frame update public override void Start() { base.Start(); // If the player has the monocle, vision-based quirks don't kick in if (Game.instance.playerStats.IsItemEquipped <Monocle>()) { return; } mLensDistortion = ScriptableObject.CreateInstance <LensDistortion>(); mLensDistortion.enabled.Override(true); mLensDistortion.intensity.Override(0f); mLensDistortion.centerX.Override(0.1f); mLensDistortion.centerY.Override(0.1f); mVolume = PostProcessManager.instance.QuickVolume(LayerMask.NameToLayer("VFXVolume"), 100f, mLensDistortion); }
// Start is called before the first frame update void Start() { vignette = ScriptableObject.CreateInstance <Vignette>(); vignette.enabled.Override(true); vignette.intensity.Override(0f); vignette.color.Override(drawVignetteColor); distortion = ScriptableObject.CreateInstance <LensDistortion>(); distortion.enabled.Override(true); distortion.intensity.Override(0f); settings = new PostProcessEffectSettings[2]; settings[0] = vignette; settings[1] = distortion; vol = PostProcessManager.instance.QuickVolume(gameObject.layer, 100f, settings); vol.priority = 1; }
private void renderLensDistortionSettings() { LensDistortion ld = TexturesUnlimitedFXLoader.INSTANCE.CurrentProfile.GetSettingsFor <LensDistortion>(); bool enabled = ld != null && ld.enabled; bool showProps = AddEffectHeader("Lens Distortion", ld); if (enabled && showProps) { AddFloatParameter("Intensity", ld.intensity, -100, 100); AddFloatParameter("IntensityX", ld.intensityX, 0, 1); AddFloatParameter("IntensityY", ld.intensityY, 0, 1); AddFloatParameter("CenterX", ld.centerX, -1, 1); AddFloatParameter("CenterY", ld.centerY, -1, 1); AddFloatParameter("Scale", ld.scale, 0.01f, 5f); } GUILayout.BeginHorizontal(); GUILayout.Label("---------------------------------------"); GUILayout.EndHorizontal(); }
void Start() { _lensDistortion = ScriptableObject.CreateInstance <LensDistortion>(); _bloom = ScriptableObject.CreateInstance <Bloom>(); _bloom.enabled.Override(true); _bloom.intensity.Override(BloomIntensityNormal); _bloom.diffusion.Override(6.5f); _colorGrading = ScriptableObject.CreateInstance <ColorGrading>(); _colorGrading.enabled.Override(true); _colorGrading.saturation.Override(100); _colorGrading.contrast.Override(7); _colorGrading.temperature.Override(7); _postProcessVolume = PostProcessManager.instance.QuickVolume(gameObject.layer, 100f, _bloom); _postProcessVolume = PostProcessManager.instance.QuickVolume(gameObject.layer, 100f, _colorGrading); _postProcessVolume = PostProcessManager.instance.QuickVolume(gameObject.layer, 100f, _lensDistortion); }
void Start() { inSlowMo = false; slowMoEffectCurrentState = 0; slowMoEffectActive = false; slowMoProfile = Instantiate(slowMoStartProfile); slowMoProfile.TryGet <ChromaticAberration>(out chromaticAberration); slowMoProfile.TryGet <LensDistortion>(out lensDistortion); slowMoProfile.TryGet <Vignette>(out vignette); chromaticAberration = Instantiate(chromaticAberration); lensDistortion = Instantiate(lensDistortion); vignette = Instantiate(vignette); for (int i = 0; i < slowMoProfile.components.Count; i++) { switch (slowMoProfile.components[i].name) { case "ChromaticAberration": slowMoProfile.components[i] = chromaticAberration; break; case "Vignette": slowMoProfile.components[i] = vignette; break; case "LensDistortion": slowMoProfile.components[i] = lensDistortion; break; } } chromaticAberration.intensity.overrideState = true; vignette.intensity.overrideState = true; lensDistortion.intensity.overrideState = true; aberrationBaseIntensity = chromaticAberration.intensity.value; distortionBaseIntensity = lensDistortion.intensity.value; vignetteBaseIntensity = vignette.intensity.value; }
void Update() { Bloom bloomLayer = null; if (_volume.profile.TryGetSettings(out bloomLayer)) { bloomLayer.intensity.value = Mathf.Min(14f, 10f * Mathf.PerlinNoise(GameLogic.Instance.LevelTime * 0.2f, 0.5f) * (0.2f + 0.1f * GameLogic.Instance.LevelTime)); } ChromaticAberration ca = null; if (_volume.profile.TryGetSettings(out ca)) { ca.intensity.value = 1f * Mathf.PerlinNoise(GameLogic.Instance.LevelTime * 0.2f, 0.5f) * (0.2f + 0.1f * GameLogic.Instance.LevelTime); } LensDistortion ld = null; if (_volume.profile.TryGetSettings(out ld)) { ld.intensity.value = Mathf.Clamp(100f * (-0.5f + Mathf.PerlinNoise(GameLogic.Instance.LevelTime * 0.2f, 0.5f) * (0.2f + 0.1f * GameLogic.Instance.LevelTime)), -60, 60); } }
private IEnumerator BloomBweepRoutine() { float timer = 0.0f; Bloom bloom = postProcess.settings[0] as Bloom; LensDistortion lens = postProcess.settings[1] as LensDistortion; float baseIntensity = 4.0f; float baseLens = 0.0f; while (timer < feedbackDuration) { bloom.intensity.value = Mathf.Lerp(baseIntensity, bloomMax, bloomCurve.Evaluate(timer / feedbackDuration)); lens.intensity.value = Mathf.Lerp(baseLens, 20, bloomCurve.Evaluate(timer / feedbackDuration)); yield return(null); timer += Time.deltaTime; } bloom.intensity.value = baseIntensity; lens.intensity.value = baseLens; }
private void Start() { // Vignette _vignette = ScriptableObject.CreateInstance <Vignette>(); _vignette.enabled.Override(true); _vignette.intensity.Override(1f); _vignette.color.Override(_vignetteColor); // Chromatic aberration _chromaticAberration = ScriptableObject.CreateInstance <ChromaticAberration>(); _chromaticAberration.enabled.Override(true); // Color grading _colorGrading = ScriptableObject.CreateInstance <ColorGrading>(); _colorGrading.enabled.Override(true); _colorGrading.gradingMode.Override(GradingMode.LowDefinitionRange); _colorGrading.colorFilter.Override(_colorGradingColor); // Lens distortion _lensDistortion = ScriptableObject.CreateInstance <LensDistortion>(); _lensDistortion.enabled.Override(true); }
void CheckDistortion() { if (DistortionParameters.Count == 0) { DistortionParameters = new List <float>(new float[4]); } else if (DistortionParameters.Count != 4) { throw new Exception("Length of DistortionParameters is not 4."); } if (LensDistortion == null || CurrentWidth != Width || CurrentHeight != Height || CurrentFieldOfView != FieldOfView || CurrentDistorted != Distorted || !Enumerable.SequenceEqual(DistortionParameters, CurrentDistortionParameters)) { // View frustum size at the focal plane. FrustumHeight = 2 * Mathf.Tan(FieldOfView / 2 * Mathf.Deg2Rad); FrustumWidth = FrustumHeight * Width / Height; if (LensDistortion == null) { LensDistortion = new LensDistortion(); } LensDistortion.InitDistortion(DistortionParameters, FrustumWidth, FrustumHeight); LensDistortion.CalculateRenderTextureSize(Width, Height, out RenderTextureWidth, out RenderTextureHeight); if (RenderTextureWidth <= 0 || RenderTextureHeight <= 0) { throw new Exception("Distortion parameters cause texture size invalid (<= 0)."); } CurrentWidth = Width; CurrentHeight = Height; CurrentFieldOfView = FieldOfView; CurrentDistorted = Distorted; CurrentDistortionParameters = new List <float>(DistortionParameters); } }
void Awake() { Volume V = GetComponent <Volume>(); if (V.profile.TryGet <DepthOfField>(out DepthOfField tmpBlur)) { Blur = tmpBlur; } if (V.profile.TryGet <Vignette>(out Vignette tmpBlack)) { Blackout = tmpBlack; } if (V.profile.TryGet <LensDistortion>(out LensDistortion tmpDistort)) { Distort = tmpDistort; } if (V.profile.TryGet <LiftGammaGain>(out LiftGammaGain tmpDark)) { Darkness = tmpDark; } }
IEnumerator Transition(Vector3 startPos, Vector3 finalPos, Camera startCam, Camera endCam, VolumeProfile startProfile, VolumeProfile endProfile, Players endPlayer) { transitionVolume.enabled = true; // Switch to more efficient method later Bloom[] bloom = new Bloom[3]; ChromaticAberration[] chromaticAberration = new ChromaticAberration[3]; LensDistortion[] lensDistortion = new LensDistortion[3]; FilmGrain[] filmGrain = new FilmGrain[3]; ShadowsMidtonesHighlights[] shadowsMidtonesHighlights = new ShadowsMidtonesHighlights[3]; PaniniProjection[] paniniProjection = new PaniniProjection[3]; WhiteBalance[] whiteBalance = new WhiteBalance[3]; DepthOfField[] depthOfField = new DepthOfField[3]; Vignette[] vignette = new Vignette[3]; transitionVolume.profile.components.Clear(); foreach (VolumeComponent c in transitionStartProfile.components.AsReadOnly()) { transitionVolume.profile.components.Add(c); } transitionVolume.profile.TryGet(out bloom[0]); transitionVolume.profile.TryGet(out chromaticAberration[0]); transitionVolume.profile.TryGet(out lensDistortion[0]); transitionVolume.profile.TryGet(out filmGrain[0]); transitionVolume.profile.TryGet(out shadowsMidtonesHighlights[0]); transitionVolume.profile.TryGet(out paniniProjection[0]); transitionVolume.profile.TryGet(out whiteBalance[0]); transitionVolume.profile.TryGet(out depthOfField[0]); transitionVolume.profile.TryGet(out vignette[0]); startProfile.TryGet(out bloom[1]); startProfile.TryGet(out chromaticAberration[1]); startProfile.TryGet(out lensDistortion[1]); startProfile.TryGet(out filmGrain[1]); startProfile.TryGet(out shadowsMidtonesHighlights[1]); startProfile.TryGet(out paniniProjection[1]); startProfile.TryGet(out whiteBalance[1]); startProfile.TryGet(out depthOfField[1]); startProfile.TryGet(out vignette[1]); endProfile.TryGet(out bloom[2]); endProfile.TryGet(out chromaticAberration[2]); endProfile.TryGet(out lensDistortion[2]); endProfile.TryGet(out filmGrain[2]); endProfile.TryGet(out shadowsMidtonesHighlights[2]); endProfile.TryGet(out paniniProjection[2]); endProfile.TryGet(out whiteBalance[2]); endProfile.TryGet(out depthOfField[2]); endProfile.TryGet(out vignette[2]); for (float i = 0; i < Mathf.PI; i += weightTransferIncrement) { float weight = Mathf.Cos(i + Mathf.PI) / 2 + 0.5f; transitionVolume.weight = Blend(0, 1, weight); yield return(new WaitForEndOfFrame()); } for (float i = 0; i < Mathf.PI; i += increment) { float weight = Mathf.Cos(i + Mathf.PI) / 2 + 0.5f; transitionTransform.position = new Vector3(Blend(startPos.x, finalPos.x, weight), Blend(startPos.y, finalPos.y, weight), Blend(startPos.z, finalPos.z, weight)); transitionCamera.transform.rotation = Quaternion.Lerp(startCam.transform.rotation, endCam.transform.rotation, i / Mathf.PI); transitionCamera.fieldOfView = Blend(startCam.fieldOfView, endCam.fieldOfView, weight); // Bloom bloom[0].threshold.value = Blend(bloom[1].threshold.value, bloom[2].threshold.value, weight); bloom[0].intensity.value = Blend(bloom[1].intensity.value, bloom[2].intensity.value, weight); bloom[0].tint.value = Color.Lerp(bloom[1].tint.value, bloom[2].tint.value, weight / Mathf.PI); // Chromatic Aberration chromaticAberration[0].intensity.value = Blend(chromaticAberration[1].intensity.value, chromaticAberration[2].intensity.value, weight); // Lens Distortion lensDistortion[0].intensity.value = Blend(lensDistortion[1].intensity.value, lensDistortion[2].intensity.value, weight); // Film Grain filmGrain[0].intensity.value = Blend(filmGrain[1].intensity.value, filmGrain[2].intensity.value, weight); filmGrain[0].response.value = Blend(filmGrain[1].response.value, filmGrain[2].response.value, weight); // Shadows Midtones and Highlights shadowsMidtonesHighlights[0].shadows.value = Vector4.Lerp(shadowsMidtonesHighlights[1].shadows.value, shadowsMidtonesHighlights[2].shadows.value, weight / Mathf.PI); shadowsMidtonesHighlights[0].midtones.value = Vector4.Lerp(shadowsMidtonesHighlights[1].midtones.value, shadowsMidtonesHighlights[2].midtones.value, weight / Mathf.PI); shadowsMidtonesHighlights[0].highlights.value = Vector4.Lerp(shadowsMidtonesHighlights[1].highlights.value, shadowsMidtonesHighlights[2].highlights.value, weight / Mathf.PI); shadowsMidtonesHighlights[0].shadowsStart.value = Blend(shadowsMidtonesHighlights[1].shadowsStart.value, shadowsMidtonesHighlights[2].shadowsStart.value, weight); shadowsMidtonesHighlights[0].shadowsEnd.value = Blend(shadowsMidtonesHighlights[1].shadowsEnd.value, shadowsMidtonesHighlights[2].shadowsEnd.value, weight); // Panini Projection paniniProjection[0].distance.value = Blend(paniniProjection[1].distance.value, paniniProjection[2].distance.value, weight); paniniProjection[0].cropToFit.value = Blend(paniniProjection[1].cropToFit.value, paniniProjection[2].cropToFit.value, weight); // White Balance whiteBalance[0].temperature.value = Blend(whiteBalance[1].temperature.value, whiteBalance[2].temperature.value, weight); whiteBalance[0].tint.value = Blend(whiteBalance[1].tint.value, whiteBalance[2].tint.value, weight); // Depth of Field depthOfField[0].mode.value = depthOfField[2].mode.value; depthOfField[0].gaussianStart.value = Blend(depthOfField[1].gaussianStart.value, depthOfField[2].gaussianStart.value, weight); depthOfField[0].gaussianEnd.value = Blend(depthOfField[1].gaussianEnd.value, depthOfField[2].gaussianEnd.value, weight); depthOfField[0].focusDistance.value = Blend(depthOfField[1].focusDistance.value, depthOfField[2].focusDistance.value, weight); depthOfField[0].focalLength.value = Blend(depthOfField[1].focalLength.value, depthOfField[2].focalLength.value, weight); depthOfField[0].aperture.value = Blend(depthOfField[1].aperture.value, depthOfField[2].aperture.value, weight); depthOfField[0].bladeCount.value = (int)Blend(depthOfField[1].bladeCount.value, depthOfField[2].bladeCount.value, weight); depthOfField[0].bladeCurvature.value = Blend(depthOfField[1].bladeCurvature.value, depthOfField[2].bladeCurvature.value, weight); depthOfField[0].bladeRotation.value = Blend(depthOfField[1].bladeRotation.value, depthOfField[2].bladeRotation.value, weight); // Vignette vignette[0].color.value = Color.Lerp(vignette[1].color.value, vignette[2].color.value, Mathf.PI / weight); vignette[0].intensity.value = Blend(vignette[1].intensity.value, vignette[2].intensity.value, weight); vignette[0].smoothness.value = Blend(vignette[1].smoothness.value, vignette[2].smoothness.value, weight); yield return(new WaitForEndOfFrame()); } for (float i = 0; i < Mathf.PI; i += weightTransferIncrement) { float weight = Mathf.Cos(i + Mathf.PI) / 2 + 0.5f; transitionVolume.weight = Blend(1, 0, weight); yield return(new WaitForEndOfFrame()); } EndTransition(); yield break; }