void Start() { bloomScript = GetComponent <BloomAndLensFlares>(); vignetteScript = GetComponent <Vignetting>(); noiseScript = GetComponent <NoiseEffect>(); if (bloomScript) { hasBloom = true; } else { hasBloom = false; } if (vignetteScript) { hasVignetting = true; } else { hasVignetting = false; } if (noiseScript) { hasNoise = true; } else { hasNoise = false; } }
private void Awake() { vignetting = Camera.main.GetComponent <Vignetting>(); vignetting.blur = 50; vignetting.blurSpread = 50; started = false; }
void Awake() { originalLayerMask = camera.cullingMask; originalFov = camera.fieldOfView; originalZ = transform.localPosition.z; vignetting = GetComponent<Vignetting>(); }
// Use this for initialization void Start() { m_vignette = GetComponent <Vignetting>(); m_defaultChroma = m_vignette.chromaticAberration; Glitch(); }
void Awake() { originalLayerMask = camera.cullingMask; originalFov = camera.fieldOfView; originalZ = transform.localPosition.z; vignetting = GetComponent <Vignetting>(); }
protected override void Awake() { base.Awake(); vignetting = GameObject.Find("_camera-back").GetComponent <Vignetting>(); vignetting.blur = 50; vignetting.blurSpread = 50; contrast = GameObject.Find("_camera-back").GetComponent <ContrastEnhance>(); }
protected override void Awake() { base.Awake(); vignetting = GameObject.Find("_camera-back").GetComponent<Vignetting>(); vignetting.blur = 50; vignetting.blurSpread = 50; contrast = GameObject.Find("_camera-back").GetComponent<ContrastEnhance>(); }
protected override void Awake() { base.Awake(); vignetting = Camera.main.GetComponent <Vignetting>(); cameraGlitch = Camera.main.GetComponent <CameraGlitch>(); drone = FindObjectOfType <DroneController>(); }
void Start() { vignetting = Camera.main.GetComponent<Vignetting>(); if( vignetting ) { vignetting.enabled = true; StartCoroutine( "DoVignettingFade" ); } }
void OnCollisionEnter(Collision other) { if (other.gameObject.tag == "HurtsPlayer") { noise = Camera.main.GetComponent<NoiseAndGrain>() as NoiseAndGrain; vignetting = Camera.main.GetComponent<Vignetting>() as Vignetting; lowPass = Camera.main.GetComponent<AudioLowPassFilter>() as AudioLowPassFilter; motionBlur = Camera.main.GetComponent<MotionBlur>() as MotionBlur; timer = effectDuration; } }
void Start() { vignetting = Camera.main.GetComponent<Vignetting>(); if( vignetting ) { vignetting.enabled = true; StartCoroutine( "DoChromaticAberrationFade" ); } }
IEnumerator SlideOut(float duration, Action onCompleted) { float startTime = Time.time; Point leftStart = _leftSlideFrame.Position; Point rightStart = _rightSlideFrame.Position; Point centerStart = _centerSlideFrame.Position; Point topStart = _topSlideFrame.Position; Point bottomStart = _bottomSlideFrame.Position; Point separatorStart = _separatorSlideFrame.Position; Point leftEnd = new Point(-_leftSlideFrame.Size.x, leftStart.y); Point rightEnd = new Point(_rightSlideFrame.Size.x, rightStart.y); Point separatorEnd = new Point(_separatorSlideFrame.Size.x, separatorStart.y); Point centerEnd = new Point(centerStart.x, _centerSlideFrame.Size.y); Point topEnd = new Point(topStart.x, -_topSlideFrame.Size.y); Point bottomEnd = new Point(bottomStart.x, _bottomSlideFrame.Size.y); Vignetting vignetting = ControlServices.Instance.ControlledCamera.Camera.GetComponents <Vignetting>()[1]; BlurEffect blur = ControlServices.Instance.ControlledCamera.Camera.GetComponent <BlurEffect>(); blur.enabled = false; while (Time.time - startTime < duration) { float t = (Time.time - startTime) / duration; _leftSlideFrame.Position = MathExt.SmoothStepPoint(leftStart, leftEnd, t); _rightSlideFrame.Position = MathExt.SmoothStepPoint(rightStart, rightEnd, t); _centerSlideFrame.Position = MathExt.SmoothStepPoint(centerStart, centerEnd, t); _topSlideFrame.Position = MathExt.SmoothStepPoint(topStart, topEnd, t); _bottomSlideFrame.Position = MathExt.SmoothStepPoint(bottomStart, bottomEnd, t); _separatorSlideFrame.Position = MathExt.SmoothStepPoint(separatorStart, separatorEnd, t); vignetting.intensity = Mathf.Lerp(2.3f, 0, t); vignetting.blur = Mathf.Lerp(2f, 0, t); vignetting.chromaticAberration = Mathf.Lerp(25f, 0, t); vignetting.blurSpread = Mathf.Lerp(3f, 0, t); yield return(null); } _leftSlideFrame.Position = leftEnd; _rightSlideFrame.Position = rightEnd; _centerSlideFrame.Position = centerEnd; _topSlideFrame.Position = topEnd; _bottomSlideFrame.Position = bottomEnd; _separatorSlideFrame.Position = separatorEnd; vignetting.intensity = 0f; vignetting.blur = 0f; vignetting.chromaticAberration = 0f; vignetting.blurSpread = 0f; this.Visible = false; onCompleted(); }
public static void InitMemberByInstance(Vignetting vignet) { mode = vignet.mode; intensity = vignet.intensity; blur = vignet.blur; blurSpread = vignet.blurSpread; luminanceDependency = vignet.luminanceDependency; chromaticAberration = vignet.chromaticAberration; axialAberration = vignet.axialAberration; blurDistance = vignet.blurDistance; }
void Awake() { leftCamera = transform.Find("TrackingSpace/LeftEyeAnchor").camera; rightCamera = transform.Find("TrackingSpace/RightEyeAnchor").camera; leftVignette = leftCamera.GetComponent<Vignetting>(); rightVignette = rightCamera.GetComponent<Vignetting>(); originalLayerMask = leftCamera.cullingMask; originalFov = leftCamera.fieldOfView; originalZ = transform.localPosition.z; }
void Awake() { leftCamera = transform.Find("TrackingSpace/LeftEyeAnchor").camera; rightCamera = transform.Find("TrackingSpace/RightEyeAnchor").camera; leftVignette = leftCamera.GetComponent <Vignetting>(); rightVignette = rightCamera.GetComponent <Vignetting>(); originalLayerMask = leftCamera.cullingMask; originalFov = leftCamera.fieldOfView; originalZ = transform.localPosition.z; }
private void Start() { m_client = (LidClient)UnityEngine.Object.FindObjectOfType(typeof(LidClient)); m_vignetteEffect = GetComponent <Vignetting>(); m_overlayEffect = GetComponent <ScreenOverlay>(); if (2 > QualitySettings.GetQualityLevel()) { SSAOEffect component = GetComponent <SSAOEffect>(); if (null != component) { UnityEngine.Object.Destroy(component); } } }
static VignettingDef() { if (vignettingEffect == null) { vignettingEffect = Util.GetComponentVar <Vignetting, VignettingDef>(vignettingEffect); } mode = Vignetting.AberrationMode.Simple; intensity = 0f; blur = 0.82f; blurSpread = 4.19f; luminanceDependency = 0.494f; chromaticAberration = -0.75f; axialAberration = 1.18f; blurDistance = 1.71f; }
// Update is called once per frame void Update() { if (Input.GetKeyDown(orthoPerspectiveCameraToggleKey)) { if (perspectiveCamera != null) { perspectiveCamera.enabled = !perspectiveCamera.enabled; orthographicCamera.enabled = !orthographicCamera.enabled; if (perspectiveCamera.enabled) { if (touchTracker != null) { touchTracker.displayTouchPointsSwitch = true; // this is trying to fix the issue with the touch track in perspective space... it turns off the touch indicator. } } if (orthographicCamera.enabled) { if (touchTracker != null) { touchTracker.displayTouchPointsSwitch = true; } } } } if (Input.GetKeyDown(dofToggleKey)) { if (perspectiveCamera != null) { DepthOfFieldScatter dof = perspectiveCamera.gameObject.GetComponent <DepthOfFieldScatter>(); dof.enabled = !dof.enabled; } } if (Input.GetKeyDown(blurToggleKey)) { if (orthographicCamera.enabled) { Blur blo = orthographicCamera.gameObject.GetComponent <Blur>(); blo.enabled = !blo.enabled; } if (perspectiveCamera != null) { if (perspectiveCamera.enabled) { Blur blp = perspectiveCamera.gameObject.GetComponent <Blur>(); blp.enabled = !blp.enabled; } } } if (Input.GetKeyDown(antialiasingToggleKey)) { if (orthographicCamera.enabled) { AntialiasingAsPostEffect aao = orthographicCamera.gameObject.GetComponent <AntialiasingAsPostEffect>(); aao.enabled = !aao.enabled; } if (perspectiveCamera != null) { if (perspectiveCamera.enabled) { AntialiasingAsPostEffect aap = perspectiveCamera.gameObject.GetComponent <AntialiasingAsPostEffect>(); aap.enabled = !aap.enabled; } } } if (Input.GetKeyDown(vignetteToggleKey)) { if (orthographicCamera.enabled) { Vignetting vigo = orthographicCamera.gameObject.GetComponent <Vignetting>(); vigo.enabled = !vigo.enabled; } if (perspectiveCamera != null) { if (perspectiveCamera.enabled) { Vignetting vigp = perspectiveCamera.gameObject.GetComponent <Vignetting>(); vigp.enabled = !vigp.enabled; } } } }
// Use this for initialization void Start() { scriptAberrationChromatique = Camera.GetComponent <Vignetting>(); }
void OnGUI() { //get the main style and apply it GUI.skin = GeneralManager.getStyle(); //move title position up and down float pos = Mathf.Sin(Time.time / 2) * 15; //GUI.Label(new Rect(Screen.width/2 - 100, Screen.height/2 - 100 + height, 200, 50), "Ascension"); //draw the title with the up and down motion GUI.DrawTexture(new Rect(Screen.width / 2 - 150, Screen.height / 2 - 200 + pos, 300, 300), (Texture2D)Resources.Load("GUITextures/Title")); //draw the start button on teh screen that will start the game if ( GUI.Button(new Rect(Screen.width / 2 - 100, Screen.height / 2 - 25 + 100, 200, 50), "Start") ) { StateToLoad.LoadLevel("newtestmap_orig", StateType.NEW_LOCAL); Application.LoadLevel("LoadMap"); } //draw button to start tutorial level if ( GUI.Button(new Rect(Screen.width / 2 - 100, Screen.height / 2 - 25 + 155, 200, 50), "How To Play") ) { Application.LoadLevel("Tutorial"); } //draw button to quit the game if ( GUI.Button(new Rect(Screen.width / 2 - 100, Screen.height / 2 - 25 + 210, 200, 50), "Quit Game") ) { Application.Quit(); } if ( SaveLocalGame.GetGameIDs().Count > 0 && GUI.Button(new Rect(Screen.width / 2 - 100, Screen.height / 2 - 25 + 260, 200, 50), "Load Game") ) { StateToLoad.LoadLevel(SaveLocalGame.GetGameIDs()[0], StateType.LOADED_LOCAL); Application.LoadLevel("LoadMap"); } //pulse the vignetting effect on the screen Vignetting v = (Vignetting)Camera.main.GetComponent("Vignetting"); if (v) { v.intensity = (0.5f * Mathf.Sin(Time.time / 2) + 0.5f) * 2 + .5f; } //center the label text for name at the bottom var centeredStyle = GUI.skin.GetStyle("Label"); centeredStyle.alignment = TextAnchor.UpperCenter; centeredStyle.fontSize = 100; GUI.color = new Color(1, 1, 1, .25f); GUI.Label(new Rect(Screen.width / 2 - 150, Screen.height - 25 - 40, 300, 50), "Created by Garrett Johnson \n\n Music by Mr.Spastic (Absolution Instrumental)", centeredStyle); }
void Start() { waterSound = GameObject.Find("WaterSound").GetComponent<AudioSource>(); waterSound.enabled = false; vig = Camera.main.GetComponent<Vignetting>(); spirit = Transform.FindObjectOfType<SpiritMovement>().gameObject.transform; anim = GetComponentInChildren<Animator>(); charGfx = anim.gameObject.transform; pMotor = GetComponent<CharacterMotor>(); pMove = GetComponent<PlayerMovement>(); startFallspeed = pMotor.movement.maxFallSpeed; pSwitch = GetComponent<PlayerSwitch>(); actionHandler = GetComponent<ActionHandler>(); if(actionHandler) { actionHandler.TakeAction += Floater; } sceneFade = Camera.main.GetComponent<SceneFade>(); leftCol.GetComponent<Collider>().enabled=false; }
void Refresh() { parser.Clear(); if (parser.DoesExist(IniFiles.CONFIG)) { parser.Load(IniFiles.CONFIG); } else { gs.Create(); parser.Load(IniFiles.CONFIG); } DepthOfField34 dof = gameObject.GetComponent <DepthOfField34>(); Bloom blf = gameObject.GetComponent <Bloom>(); AmbientObscurance ssao = gameObject.GetComponent <AmbientObscurance>(); SunShafts sunshaft = gameObject.GetComponent <SunShafts>(); NoiseAndGrain nag = gameObject.GetComponent <NoiseAndGrain>(); EdgeDetectEffectNormals edn = gameObject.GetComponent <EdgeDetectEffectNormals>(); Vignetting vig = gameObject.GetComponent <Vignetting>(); if (bool.Parse(parser.Get("fx_enable"))) { if (bool.Parse(parser.Get("fx_dof"))) { dof.enabled = true; dof.resolution = DofResolution.High; dof.quality = bool.Parse(parser.Get("fx_dof_foreground")) ? Dof34QualitySetting.BackgroundAndForeground : Dof34QualitySetting.OnlyBackground; dof.bokeh = bool.Parse(parser.Get("fx_dof_bokeh")) ? true : false; dof.focalPoint = float.Parse(parser.Get("fx_dof_focaldistance")); dof.smoothness = float.Parse(parser.Get("fx_dof_smoothness")); dof.focalSize = float.Parse(parser.Get("fx_dof_focalSize")); dof.visualize = bool.Parse(parser.Get("fx_dof_visualizeFocus")); switch (parser.Get("fx_dof_blurriness")) { case "0": dof.bluriness = DofBlurriness.Low; break; case "1": dof.bluriness = DofBlurriness.High; break; case "2": dof.bluriness = DofBlurriness.VeryHigh; break; default: dof.bluriness = DofBlurriness.High; break; } dof.maxBlurSpread = float.Parse(parser.Get("fx_dof_blurSpread")); dof.foregroundBlurExtrude = float.Parse(parser.Get("fx_dof_foregroundSize")); switch (parser.Get("fx_dof_bokeh_destination")) { case "0": dof.bokehDestination = BokehDestination.Background; break; case "1": dof.bokehDestination = BokehDestination.BackgroundAndForeground; break; case "2": dof.bokehDestination = BokehDestination.Foreground; break; default: dof.bokehDestination = BokehDestination.Background; break; } dof.bokehIntensity = float.Parse(parser.Get("fx_dof_bokeh_intensity")); dof.bokehThreshholdLuminance = float.Parse(parser.Get("fx_dof_bokeh_minLuminance")); dof.bokehThreshholdContrast = float.Parse(parser.Get("fx_dof_bokeh_minContrast")); dof.bokehDownsample = int.Parse(parser.Get("fx_dof_bokeh_DownSample")); dof.bokehScale = float.Parse(parser.Get("fx_dof_bokeh_sizeScale")); } else { dof.enabled = false; } // SSAO if (bool.Parse(parser.Get("fx_SSAO"))) { ssao.enabled = true; ssao.intensity = float.Parse(parser.Get("fx_SSAO_intensity")); ssao.radius = float.Parse(parser.Get("fx_SSAO_radius")); ssao.blurIterations = int.Parse(parser.Get("fx_SSAO_blurIterations")); ssao.blurFilterDistance = float.Parse(parser.Get("fx_SSAO_blurFilterDistance")); ssao.downsample = int.Parse(parser.Get("fx_SSAO_downsample")); } else { ssao.enabled = false; } // NOISE GRAIN nag.enabled = bool.Parse(parser.Get("fx_noisegrain")) ? true : false; nag.intensityMultiplier = float.Parse(parser.Get("fx_noisegrain_intensity")); // BLOOM if (bool.Parse(parser.Get("fx_bloom"))) { blf.enabled = true; switch (parser.Get("fx_bloom_quality")) { case "0": blf.quality = Bloom.BloomQuality.Cheap; break; case "1": blf.quality = Bloom.BloomQuality.High; break; default: blf.quality = Bloom.BloomQuality.High; break; } switch (parser.Get("fx_bloom_mode")) { case "0": blf.tweakMode = Bloom.TweakMode.Basic; break; case "1": blf.tweakMode = Bloom.TweakMode.Complex; break; default: blf.tweakMode = Bloom.TweakMode.Complex; break; } switch (parser.Get("fx_bloom_blendMode")) { case "0": blf.screenBlendMode = Bloom.BloomScreenBlendMode.Screen; break; case "1": blf.screenBlendMode = Bloom.BloomScreenBlendMode.Add; break; default: blf.screenBlendMode = Bloom.BloomScreenBlendMode.Add; break; } blf.hdr = bool.Parse(parser.Get("fx_bloom_hdr")) ? Bloom.HDRBloomMode.On : Bloom.HDRBloomMode.Off; blf.bloomIntensity = float.Parse(parser.Get("fx_bloom_intensity")); blf.bloomThreshhold = float.Parse(parser.Get("fx_bloom_threshhold")); blf.bloomBlurIterations = int.Parse(parser.Get("fx_bloom_blurIterations")); blf.blurWidth = float.Parse(parser.Get("fx_bloom_sampleDistance")); switch (parser.Get("fx_bloom_lensFlareMode")) { case "0": blf.lensflareMode = Bloom.LensFlareStyle.Ghosting; break; case "1": blf.lensflareMode = Bloom.LensFlareStyle.Anamorphic; break; case "2": blf.lensflareMode = Bloom.LensFlareStyle.Combined; break; default: blf.lensflareMode = Bloom.LensFlareStyle.Ghosting; break; } blf.lensflareIntensity = float.Parse(parser.Get("fx_bloom_LFlocalIntensity")); blf.lensflareThreshhold = float.Parse(parser.Get("fx_bloom_LFthreshhold")); } else { blf.enabled = false; } // Sunshafts if (bool.Parse(parser.Get("fx_sunshaft"))) { sunshaft.enabled = true; sunshaft.useDepthTexture = bool.Parse(parser.Get("fx_sunshaft_zBuffer")); switch (parser.Get("fx_sunshaft_resolution")) { case "0": sunshaft.resolution = SunShaftsResolution.Low; break; case "1": sunshaft.resolution = SunShaftsResolution.Normal; break; case "2": sunshaft.resolution = SunShaftsResolution.High; break; default: sunshaft.resolution = SunShaftsResolution.Normal; break; } switch (parser.Get("fx_sunshaft_blendMode")) { case "0": sunshaft.screenBlendMode = ShaftsScreenBlendMode.Add; break; case "1": sunshaft.screenBlendMode = ShaftsScreenBlendMode.Screen; break; default: sunshaft.screenBlendMode = ShaftsScreenBlendMode.Screen; break; } sunshaft.maxRadius = float.Parse(parser.Get("fx_sunshaft_distFalloff")); sunshaft.sunShaftBlurRadius = float.Parse(parser.Get("fx_sunshaft_blurSize")); sunshaft.radialBlurIterations = int.Parse(parser.Get("fx_sunshaft_blurIterations")); sunshaft.sunShaftIntensity = float.Parse(parser.Get("fx_sunshaft_intensity")); sunshaft.useSkyBoxAlpha = float.Parse(parser.Get("fx_sunshaft_alphaMask")); } else { sunshaft.enabled = false; } // Edge detect edn.enabled = bool.Parse(parser.Get("fx_edgeDetect")) ? true : false; // Vignetting if (bool.Parse(parser.Get("fx_vignetting"))) { vig.enabled = true; vig.intensity = float.Parse(parser.Get("fx_vignetting_intensity")); vig.blurSpread = float.Parse(parser.Get("fx_vignetting_blurredCornors")); vig.chromaticAberration = float.Parse(parser.Get("fx_vignetting_aberration")); } else { vig.enabled = false; } } else { dof.enabled = false; ssao.enabled = false; nag.enabled = false; blf.enabled = false; sunshaft.enabled = false; edn.enabled = false; vig.enabled = false; } }
void Awake() { vig = GetComponent<Vignetting>(); motorParent = transform.parent.gameObject; motor = transform.parent.GetComponent<CharacterMotor>(); }
void Start() { ca = GetComponent<Vignetting>(); }
// Use this for initialization void Start() { audio = GetComponent<AudioSource>(); audio.volume = 0; audio.enabled = false; enabled = false; increasing = false; decreasing = false; countingDown = false; NPCsLookingAtPlayer = "null_npc"; PlayerLookingNPCTarget = "null_player"; currentBlur = GetComponent<Blur>(); currentVign = GetComponent<Vignetting>(); currentTwirl = GetComponent<TwirlEffect>(); currentVortex = GetComponent<VortexEffect>(); vignDefaultIntensity = currentVign.intensity; currentBlur.enabled = false; currentVign.enabled = false; currentTwirl.enabled = false; currentVortex.enabled = false; }
void Start() { ca = GetComponent <Vignetting>(); }
void Awake() { vignetting = GetComponent<Vignetting>(); Singletons.timeManager.OnTimeWarpChangedEvent += OnTimeWarpChanged; }