Пример #1
0
        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);
            }
        }
    void SetBloom(float b)
    {
        BloomModel pb = PPProfile.bloom;

        BloomModel.Settings      bms = pb.settings;
        BloomModel.BloomSettings bs  = bms.bloom;
        bs.intensity    = b;
        bms.bloom       = bs;
        pb.settings     = bms;
        PPProfile.bloom = pb;
    }
Пример #3
0
    private void TweenBloomAberration(float time, AnimationCurve curve)
    {
        BloomModel bloomModel = postProcessingBehaviour.profile.bloom;

        BloomModel.Settings bloomModelSetting = postProcessingBehaviour.profile.bloom.settings;


        LeanTween.value(0, 1, time).setEase(curve).setOnUpdate(delegate(float val) {
            bloomModelSetting.bloom.intensity = val;

            bloomModel.settings = bloomModelSetting;
        });
    }
Пример #4
0
        void SetBloom(float value)
        {
            BloomModel bloom = cam.GetComponent <PostProcessingBehaviour>().profile.bloom;

            BloomModel.Settings tempSettings = bloom.settings;
            tempSettings.bloom.intensity = 0.2f * (value / 100);
            bloom.settings = tempSettings;

            if (value <= 0)
            {
                bloom.enabled = false;
            }
            else
            {
                bloom.enabled = true;
            }
        }
    IEnumerator save_Bloom()
    {
        yield return(new WaitForEndOfFrame());

        for (int a = 0; a < pb.Length; a++)
        {
            BloomModel m = pb [a].profile.bloom;

            if (bloom.value == 0)
            {
                m.enabled = false;
                PlayerPrefs.SetString("Bloom", "Off");
            }
            if (bloom.value == 1)
            {
                m.enabled = true;
                PlayerPrefs.SetString("Bloom", "On");
            }

            pb [a].profile.bloom = m;
        }
    }
 /**
  * Create a new bloom effect menu with or without an existing config.
  */
 public BloomPanel(BloomModel model)
 {
     m_model = model;
 }