public void Save(AmplifyOcclusionEffect component)
 {
     if (component != null)
     {
         this.enabled             = component.enabled;
         this.ApplyMethod         = (int)component.ApplyMethod;
         this.FilterResponse      = component.FilterResponse;
         this.FilterBlending      = component.FilterBlending;
         this.FilterEnabled       = component.FilterEnabled;
         this.BlurSharpness       = component.BlurSharpness;
         this.BlurPasses          = component.BlurPasses;
         this.BlurRadius          = component.BlurRadius;
         this.BlurEnabled         = component.BlurEnabled;
         this.FadeToThickness     = component.FadeToThickness;
         this.FadeToPowerExponent = component.FadeToPowerExponent;
         this.FadeToRadius        = component.FadeToRadius;
         this.FadeToTint          = component.FadeToTint;
         this.FadeLength          = component.FadeLength;
         this.FadeToIntensity     = component.FadeToIntensity;
         this.FadeEnabled         = component.FadeEnabled;
         this.CacheAware          = component.CacheAware;
         this.Downsample          = component.Downsample;
         this.Thickness           = component.Thickness;
         this.Bias            = component.Bias;
         this.PowerExponent   = component.PowerExponent;
         this.Radius          = component.Radius;
         this.Tint            = component.Tint;
         this.Intensity       = component.Intensity;
         this.PerPixelNormals = (int)component.PerPixelNormals;
         this.SampleCount     = (int)component.SampleCount;
         this.FadeStart       = component.FadeStart;
     }
 }
 public void Load(AmplifyOcclusionEffect component)
 {
     if (component != null)
     {
         component.enabled             = this.enabled;
         component.ApplyMethod         = (ApplicationMethod)this.ApplyMethod;
         component.FilterResponse      = this.FilterResponse;
         component.FilterBlending      = this.FilterBlending;
         component.FilterEnabled       = this.FilterEnabled;
         component.BlurSharpness       = this.BlurSharpness;
         component.BlurPasses          = this.BlurPasses;
         component.BlurRadius          = this.BlurRadius;
         component.BlurEnabled         = this.BlurEnabled;
         component.FadeToThickness     = this.FadeToThickness;
         component.FadeToPowerExponent = this.FadeToPowerExponent;
         component.FadeToRadius        = this.FadeToRadius;
         component.FadeToTint          = this.FadeToTint;
         component.FadeLength          = this.FadeLength;
         component.FadeToIntensity     = this.FadeToIntensity;
         component.FadeEnabled         = this.FadeEnabled;
         component.CacheAware          = this.CacheAware;
         component.Downsample          = this.Downsample;
         component.Thickness           = this.Thickness;
         component.Bias            = this.Bias;
         component.PowerExponent   = this.PowerExponent;
         component.Radius          = this.Radius;
         component.Tint            = this.Tint;
         component.Intensity       = this.Intensity;
         component.PerPixelNormals = (PerPixelNormalSource)this.PerPixelNormals;
         component.SampleCount     = (SampleCountLevel)this.SampleCount;
         component.FadeStart       = this.FadeStart;
     }
 }
Esempio n. 3
0
        private void maybeAddAmplifyOcclusion(Camera vrCamera)
        {
            if (vrCamera == null)
            {
                return;
            }
            AmplifyOcclusionEffect effect = vrCamera.gameObject.GetComponent <AmplifyOcclusionEffect>();

            if (effect != null)
            {
                return;
            }
            vrCamera.gameObject.AddComponent <AmplifyOcclusionEffect>();
        }
        internal PostProcessVolume SetupVolume()
        {
            // Turn off everything, We're not going to use
            foreach (PostProcessVolume postProcessVolume in GameObject.FindObjectsOfType <PostProcessVolume>())
            {
                if (SettingValues.profile == null && (postProcessVolume.name == "PostProcessVolume3D" || postProcessVolume.name == "PostProcessVolume"))
                {
                    SettingValues.profile      = GameObject.Instantiate(postProcessVolume.profile);
                    SettingValues.profile.name = "AIGraphics Post Processing Profile";
                    InitializeProfiles();
                }

                postProcessVolume.weight  = 0;
                postProcessVolume.enabled = false;
            }
            if (SettingValues.profile == null)
            {
                // Just in case
                SettingValues.profile = (PostProcessProfile)ScriptableObject.CreateInstance("PostProcessProfile");
                InitializeProfiles();
            }

            _volume                  = AIGraphics.Instance.GetOrAddComponent <PostProcessVolume>();
            _volume.enabled          = true;
            _volume.isGlobal         = true;
            _volume.blendDistance    = 0;
            _volume.weight           = 1;
            _volume.priority         = 1;
            _volume.useGUILayout     = true;
            _volume.sharedProfile    = SettingValues.profile;
            _volume.profile          = SettingValues.profile;
            _volume.gameObject.layer = LayerMask.NameToLayer("PostProcessing");

            if (initialCamera != null)
            {
                amplifyOcclusionComponent = initialCamera.GetComponent <AmplifyOcclusionEffect>();
            }

            return(_volume);
        }
Esempio n. 5
0
    private void UpdatePostProcess()
    {
        foreach (Camera cam in Camera.allCameras)
        {
            SMAA                   defAntiAlias = cam.GetComponent <SMAA>();
            Bloom                  b            = cam.GetComponent <Bloom>();
            BloomAndFlares         baf          = cam.GetComponent <BloomAndFlares>();
            ContrastEnhance        ce           = cam.GetComponent <ContrastEnhance>();
            MotionBlur             mb           = cam.GetComponent <MotionBlur>();
            WeaponDepthOfField     wdof         = cam.GetComponent <WeaponDepthOfField>();
            SunShafts              ss           = cam.GetComponent <SunShafts>();
            AmplifyOcclusionEffect ao           = cam.GetComponent <AmplifyOcclusionEffect>();
            ColorCorrection        ccc          = cam.GetComponent <ColorCorrection>();

            if (defAntiAlias)
            {
                defAntiAlias.enabled = (antiAliasing == 1);
            }

            if (wdof)
            {
                wdof.enabled = (wDepthOfField == 1);
            }

            bool bloomBool = (bloom == 1);
            if (baf)
            {
                baf.enabled = bloomBool;
            }
            if (b)
            {
                b.enabled = bloomBool;
            }

            if (ss)
            {
                ss.enabled = (sunShafts == 1);
            }
            if (mb)
            {
                mb.enabled = (motionBlur == 1);
            }

            bool ssaoBool = (SSAO == 1);
            if (ao)
            {
                ao.enabled = ssaoBool;
            }

            bool ccBool = (colorCorrection == 1);
            if (ccc)
            {
                ccc.enabled = ccBool;
            }
            if (ce)
            {
                ce.enabled = ccBool;
            }
        }

        lastPP      = Time.unscaledTime;
        cameraCount = Camera.allCameras.Length;
    }