void Start() { m_cam = Camera.main; m_sunShafts = m_cam.GetComponent<SunShafts>(); m_bloom = m_cam.GetComponent<Bloom>(); m_motionBlur = m_cam.GetComponent<CameraMotionBlur>(); m_antiAliasing = m_cam.GetComponent<AntiAliasing>(); m_colorGrading = m_cam.GetComponent<TonemappingColorGrading>(); m_defaultGrading = m_colorGrading.colorGrading; GameController.GameOver += OnGameOver; }
private void AddImageEffects() { for (int i = 0; i < RaceSettings.ships.Count; ++i) { if (RaceSettings.ships[i].cam != null) { // bloom //Kino.Bloom bloom = RaceSettings.ships[i].cam.gameObject.AddComponent<Kino.Bloom>(); //bloom.radius = 1.0f; UnityStandardAssets.ImageEffects.Bloom bloom = RaceSettings.ships[i].cam.gameObject.AddComponent<UnityStandardAssets.ImageEffects.Bloom>(); bloom.tweakMode = UnityStandardAssets.ImageEffects.Bloom.TweakMode.Complex; bloom.bloomIntensity = 1f;// 0.1f; bloom.bloomThreshold = 4; bloom.bloomThresholdColor = new Color(0, 255, 202, 255); bloom.bloomBlurIterations = 1; bloom.sepBlurSpread = 4.09f; bloom.lensFlareShader = Shader.Find("Hidden/LensFlareCreate"); bloom.screenBlendShader = Shader.Find("Hidden/BlendForBloom"); bloom.blurAndFlaresShader = Shader.Find("Hidden/BlurAndFlares"); bloom.brightPassFilterShader = Shader.Find("Hidden/BrightPassFilter2"); //bloom.blurAndFlaresShader ppBlooms.Add(bloom); // fxaa AntiAliasingManager aa = RaceSettings.ships[i].cam.gameObject.AddComponent<AntiAliasingManager>(); ppAA.Add(aa); // ao AmbientOcclusion ao = RaceSettings.ships[i].cam.gameObject.AddComponent<AmbientOcclusion>(); ao.settings.intensity = 1f; ao.settings.radius = 0.3f; ppAO.Add(ao); // tonemapping TonemappingColorGrading tm = RaceSettings.ships[i].cam.gameObject.AddComponent<TonemappingColorGrading>(); TonemappingColorGrading.ColorGradingSettings settings = new TonemappingColorGrading.ColorGradingSettings(); settings.basics.temperatureShift = 0.3f; settings.basics.saturation = 1f; settings.basics.value = 1f; settings.basics.gain = 1.5f; tm.colorGrading = settings; //tm.tonemapper = Shader.Find("Hidden/Tonemapper"); //tm.type = Tonemapping.TonemapperType.AdaptiveReinhardAutoWhite; ppTonemapping.Add(tm); // Dynamic Resolution DynamicResolution dr = RaceSettings.ships[i].cam.gameObject.AddComponent<DynamicResolution>(); ppDynamicResolution.Add(dr); //CameraMotionBlur cmb = RaceSettings.ships[i].cam.gameObject.AddComponent<CameraMotionBlur>(); //cmb. } } }