public void Start() { try { _camera = Camera.main; _zoomButton = GameObject.Find("ZoomButton").GetComponent <UIMultiStateButton>(); _mainPanel = GameObject.Find("RenderItMainPanel").GetComponent <MainPanel>(); _postProcessingBehaviour = _camera.gameObject.GetComponent <PostProcessingBehaviour>(); if (_postProcessingBehaviour == null) { _postProcessingBehaviour = _camera.gameObject.AddComponent <PostProcessingBehaviour>(); _postProcessingBehaviour.profile = ScriptableObject.CreateInstance <PostProcessingProfile>(); } _postProcessingBehaviour.enabled = true; _antialiasingModel = new AntialiasingModel(); _ambientOcclusionModel = new AmbientOcclusionModel(); _bloomModel = new BloomModel(); _colorGradingModel = new ColorGradingModel(); _renderItAtlas = LoadResources(); CreateUI(); } catch (Exception e) { Debug.Log("[Render It!] ModManager:Start -> Exception: " + e.Message); } }
IEnumerator save_AntiAliasing() { yield return(new WaitForEndOfFrame()); for (int a = 0; a < pb.Length; a++) { AntialiasingModel m = pb [a].profile.antialiasing; if (antiAliasing.value == 0) { m.enabled = false; PlayerPrefs.SetString("AA", "Off"); } if (antiAliasing.value == 1) { AntialiasingModel.Settings s = pb [a].profile.antialiasing.settings; m.enabled = true; s.method = AntialiasingModel.Method.Fxaa; m.settings = s; PlayerPrefs.SetString("AA", "FXAA"); } if (antiAliasing.value == 2) { AntialiasingModel.Settings s = pb [a].profile.antialiasing.settings; m.enabled = true; s.method = AntialiasingModel.Method.Taa; m.settings = s; PlayerPrefs.SetString("AA", "TAA"); } pb [a].profile.antialiasing = m; } }
void SetAntiAliasing(int value) { AntialiasingModel aa = cam.GetComponent <PostProcessingBehaviour>().profile.antialiasing; if (value == 2) { aa.enabled = true; AntialiasingModel.Settings tempSettings = aa.settings; tempSettings.method = AntialiasingModel.Method.Taa; aa.settings = tempSettings; } else if (value == 1) { aa.enabled = true; AntialiasingModel.Settings tempSettings = aa.settings; tempSettings.method = AntialiasingModel.Method.Fxaa; aa.settings = tempSettings; } else { aa.enabled = false; } }
// Shaders loaded from the asset bundle public AntiAliasingPanel(AntialiasingModel model) { m_model = model; }