Exemple #1
0
    // Override: MonoBehaviour::Start()
    void Start()
    {
        // Local variables
        AntialiasingAsPostEffect dlaa = GameObject.FindObjectOfType <AntialiasingAsPostEffect>();
        SSAOEffect ssao = GameObject.FindObjectOfType <SSAOEffect>();

        // Set global variable
        if (Game.Instance.ScriptEngine.IsGlobalVar("level_32_visited") == false)
        {
            Game.Instance.ScriptEngine.AddGlobalVar("level_32_visited", true);
        }

        // Shield from Bob collected?
        if (m_higgins != null && Game.Instance.ScriptEngine.IsGlobalVar("level_2_bob_received_shield") == false)
        {
            m_higgins.gameObject.SetActive(true);
        }

        // Disable DLAA if quality level is below beautiful
        if (dlaa != null && QualityLevel.getCurrentLevelIndex() < QualityLevel.LEVEL_INDEX_BEAUTIFUL)
        {
            dlaa.enabled = false;
        }

        // Disable SSAO if quality level is below beautiful
        if (ssao != null && QualityLevel.getCurrentLevelIndex() < QualityLevel.LEVEL_INDEX_BEAUTIFUL)
        {
            ssao.enabled = false;
        }
    }
    // Override: MonoBehaviour::Start()
    void Start()
    {
        // Local variables
        AntialiasingAsPostEffect dlaa = GameObject.FindObjectOfType <AntialiasingAsPostEffect>();
        SSAOEffect ssao         = GameObject.FindObjectOfType <SSAOEffect>();
        Bloom      bloom        = GameObject.FindObjectOfType <Bloom>();
        Camera     playerCamera = GameObject.FindObjectOfType <Camera>();

        // Set global variable
        if (Game.Instance.ScriptEngine.IsGlobalVar("level_11_visited") == false)
        {
            Game.Instance.ScriptEngine.AddGlobalVar("level_11_visited", true);
        }

        // Disable DLAA if quality level is below beautiful
        if (dlaa != null && QualityLevel.getCurrentLevelIndex() < QualityLevel.LEVEL_INDEX_BEAUTIFUL)
        {
            dlaa.enabled = false;
        }

        // Disable SSAO if quality level is below beautiful
        if (ssao != null && QualityLevel.getCurrentLevelIndex() < QualityLevel.LEVEL_INDEX_BEAUTIFUL)
        {
            ssao.enabled = false;
        }

        // Disable bloom if quality level is below fantastic
        if (playerCamera != null && bloom != null && QualityLevel.getCurrentLevelIndex() < QualityLevel.LEVEL_INDEX_FANTASTIC)
        {
            playerCamera.hdr = false;
            bloom.enabled    = false;
        }
    }
 public static void InitMemberByInstance(AntialiasingAsPostEffect antialiasingEffect)
 {
     mode                 = antialiasingEffect.mode;
     dlaaSharp            = antialiasingEffect.dlaaSharp;
     showGeneratedNormals = antialiasingEffect.showGeneratedNormals;
     blurRadius           = antialiasingEffect.blurRadius;
     edgeSharpness        = antialiasingEffect.edgeSharpness;
     edgeThreshold        = antialiasingEffect.edgeThreshold;
     edgeThresholdMin     = antialiasingEffect.edgeThresholdMin;
     offsetScale          = antialiasingEffect.offsetScale;
 }
Exemple #4
0
    // Override: MonoBehaviour::Start()
    void Start()
    {
        // Local variables
        bool visited = Game.Instance.ScriptEngine.IsGlobalVar("level_31_visited");
        AntialiasingAsPostEffect dlaa = GameObject.FindObjectOfType <AntialiasingAsPostEffect>();
        SSAOEffect ssao = GameObject.FindObjectOfType <SSAOEffect>();

        // Set global variable
        if (visited == false)
        {
            Game.Instance.ScriptEngine.AddGlobalVar("level_31_visited", true);
        }

        // Disable background particles if quality level is simple or below
        if (m_backgroundParticle != null && QualityLevel.getCurrentLevelIndex() <= QualityLevel.LEVEL_INDEX_SIMPLE)
        {
            m_backgroundParticle.SetActive(false);
        }

        // Disable DLAA if quality level is below beautiful
        if (dlaa != null && QualityLevel.getCurrentLevelIndex() < QualityLevel.LEVEL_INDEX_BEAUTIFUL)
        {
            dlaa.enabled = false;
        }

        // Disable SSAO if quality level is below beautiful
        if (ssao != null && QualityLevel.getCurrentLevelIndex() < QualityLevel.LEVEL_INDEX_BEAUTIFUL)
        {
            ssao.enabled = false;
        }

        // Delete pursuit of the two birds if the level was already visited by the player
        if (visited == true && Game.Instance.ScriptEngine.IsGlobalVar("level_32_visited"))
        {
            if (m_transitionPursuit != null)
            {
                GameObject.Destroy(m_transitionPursuit);
            }
            if (m_pursuitBird1 != null)
            {
                GameObject.Destroy(m_pursuitBird1);
            }
            if (m_pursuitBird2 != null)
            {
                GameObject.Destroy(m_pursuitBird2);
            }
        }
    }
        static AntialiasingDef()
        {
            if (antialiasingEffect == null)
            {
                antialiasingEffect = Util.GetComponentVar <AntialiasingAsPostEffect, AntialiasingDef>(antialiasingEffect);
            }

            mode                 = AAMode.FXAA3Console;
            dlaaSharp            = false;
            showGeneratedNormals = false;
            blurRadius           = 18f;
            edgeSharpness        = 4f;
            edgeThreshold        = 0.2f;
            edgeThresholdMin     = 0.05f;
            offsetScale          = 0.2f;
        }
Exemple #6
0
    // Override: MonoBehaviour::Start()
    void Start()
    {
        // Local variables
        AntialiasingAsPostEffect dlaa = GameObject.FindObjectOfType <AntialiasingAsPostEffect>();
        SSAOEffect ssao         = GameObject.FindObjectOfType <SSAOEffect>();
        Bloom      bloom        = GameObject.FindObjectOfType <Bloom>();
        Camera     playerCamera = GameObject.FindObjectOfType <Camera>();

        // Set global variable
        if (Game.Instance.ScriptEngine.IsGlobalVar("level_21_visited") == false)
        {
            Game.Instance.ScriptEngine.AddGlobalVar("level_21_visited", true);
        }

        // Destroy entry if necessary
        if (m_destroyEntry != null && Game.Instance.ScriptEngine.IsGlobalVar("level_21_cave_destroyed") == true)
        {
            m_destroyEntry.onActivate();
        }

        // Disable background particles if quality level is simple or below
        if (m_backgroundParticle != null && QualityLevel.getCurrentLevelIndex() <= QualityLevel.LEVEL_INDEX_SIMPLE)
        {
            m_backgroundParticle.SetActive(false);
        }

        // Disable DLAA if quality level is below beautiful
        if (dlaa != null && QualityLevel.getCurrentLevelIndex() < QualityLevel.LEVEL_INDEX_BEAUTIFUL)
        {
            dlaa.enabled = false;
        }

        // Disable SSAO if quality level is below beautiful
        if (ssao != null && QualityLevel.getCurrentLevelIndex() < QualityLevel.LEVEL_INDEX_BEAUTIFUL)
        {
            ssao.enabled = false;
        }

        // Disable bloom if quality level is below fantastic
        if (playerCamera != null && bloom != null && QualityLevel.getCurrentLevelIndex() < QualityLevel.LEVEL_INDEX_FANTASTIC)
        {
            playerCamera.hdr = false;
            bloom.enabled    = false;
        }
    }
Exemple #7
0
    private void SettingApplied(Object sender, EventArgs e)
    {
        AntialiasingAsPostEffect component = GetComponent <AntialiasingAsPostEffect>();

        component.enabled = true;
        switch (GraphicsConfigManager.Settings.Antialiasing)
        {
        case EFSAAMode.Off:
            component.enabled = false;
            break;

        case EFSAAMode.FXAA3:
            component.mode = AAMode.FXAA3Console;
            break;

        case EFSAAMode.FXAA2:
            component.mode = AAMode.FXAA2;
            break;

        case EFSAAMode.FXAA1A:
            component.mode = AAMode.FXAA1PresetA;
            break;

        case EFSAAMode.FXAA1B:
            component.mode = AAMode.FXAA1PresetB;
            break;

        case EFSAAMode.NFAA:
            component.mode = AAMode.NFAA;
            break;

        case EFSAAMode.SSAA:
            component.mode = AAMode.SSAA;
            break;

        case EFSAAMode.DLAA:
            component.mode = AAMode.DLAA;
            break;
        }
    }
Exemple #8
0
    // 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;
                }
            }
        }
    }
        public void Setup(Camera source, Portal portal, Portal otherPortal, int[] remove, int[] add, PortalCameraControl par = null, float nearclipoffset = 0f, bool ignoreFog = false)
        {
            if (par)
            {
                hasParent    = true;
                parentCamera = par;
            }
            setUp               = true;
            this.source         = source;
            this.portal         = portal;
            this.otherPortal    = otherPortal;
            this.nearClipOffset = nearclipoffset;

            if (portalDummy == null)
            {
                portalDummy        = new GameObject(portal.name + " Dummy").transform;
                portalDummy.parent = portal.transform;
            }
            if (otherDummy == null)
            {
                otherDummy        = new GameObject(otherPortal.name + " Dummy").transform;
                otherDummy.parent = otherPortal.transform;
            }

            camera = gameObject.AddComponent <Camera>();
            camera.CopyFrom(Camera.main);
            int i;

            for (i = 0; i < remove.Length; i++)
            {
                camera.cullingMask = VidyaMod.RemoveFromLayerMask(camera.cullingMask, remove[i]);
                //camera.cullingMask = camera.cullingMask & ~(1 << remove[i]);//remove layer
            }
            for (i = 0; i < add.Length; i++)
            {
                camera.cullingMask = VidyaMod.AddToLayerMask(camera.cullingMask, add[i]);
                //camera.cullingMask = camera.cullingMask | (1 << add[i]);//add
            }
            camera.depth = -2;

            sourceBloom = Camera.main.GetComponent <BloomAndLensFlares>();
            sourceSsao  = Camera.main.GetComponent <SSAOPro>();
            sourceAa    = Camera.main.GetComponent <AntialiasingAsPostEffect>();
            sourceFog   = Camera.main.GetComponent <ColorfulFog>();

            bloom = ModUtility.CopyComponent <BloomAndLensFlares>(sourceBloom, gameObject);
            ssao  = ModUtility.CopyComponent <SSAOPro>(sourceSsao, gameObject);
            aa    = ModUtility.CopyComponent <AntialiasingAsPostEffect>(sourceAa, gameObject);
            fog   = ModUtility.CopyComponent <ColorfulFog>(sourceFog, gameObject);

            bloom.enabled = false;
            ssao.enabled  = sourceSsao.enabled;
            aa.enabled    = sourceAa.enabled;
            fog.enabled   = sourceFog.enabled;

            layer   = add[0];
            ignored = ignoreFog;
            ProcessFog();

            UpdateFOV();
            ReferenceMaster.onFOVChanged += UpdateFOV;
        }