Exemplo n.º 1
0
    public void ReplaceGlobalCharacterOutline(float scale)
    {
        RenderSettings.GlobalCharacterOutlineScale = scale;
        RenderSettingsBase rsb = RenderSettingsManager.Instance.GetCurrentRenderSettings();
        RenderSettings     rs  = rsb as RenderSettings;

        if (rs != null)
        {
            float use = scale * rs.CharactorOutlineScale;
            Shader.SetGlobalFloat("_EBGCharOutlineScale", use);
        }
    }
Exemplo n.º 2
0
    public override void ApplyBlend(RenderSettingsBase source, RenderSettingsBase dest, float destFactor)
    {
        //EB.Debug.Log ("BLEND: " + destFactor);

        RenderSettings RSdest   = (RenderSettings)dest;
        RenderSettings RSsource = (RenderSettings)source;

        LightProbeScale  = Mathf.Lerp(RSsource.LightProbeScale, RSdest.LightProbeScale, destFactor);
        LightProbeOffset = Mathf.Lerp(RSsource.LightProbeOffset, RSdest.LightProbeOffset, destFactor);
        LightProbeMax    = Mathf.Lerp(RSsource.LightProbeMax, RSdest.LightProbeMax, destFactor);

        GlobalLightAmbient    = Color.Lerp(RSsource.GlobalLightAmbient, RSdest.GlobalLightAmbient, destFactor);
        GlobalLightDiffuse    = Color.Lerp(RSsource.GlobalLightDiffuse, RSdest.GlobalLightDiffuse, destFactor);
        GlobalLightDiffuse1   = Color.Lerp(RSsource.GlobalLightDiffuse1, RSdest.GlobalLightDiffuse1, destFactor);
        GlobalLightSpecular   = Color.Lerp(RSsource.GlobalLightSpecular, RSdest.GlobalLightSpecular, destFactor);
        GlobalCharColorScale  = Color.Lerp(RSsource.GlobalCharColorScale, RSdest.GlobalCharColorScale, destFactor);
        GlobalLightRotation   = Vector3.Lerp(RSsource.GlobalLightRotation, RSdest.GlobalLightRotation, destFactor);
        GlobalLightRotation1  = Vector3.Lerp(RSsource.GlobalLightRotation1, RSdest.GlobalLightRotation1, destFactor);
        CharactorOutlineScale = Mathf.Lerp(RSsource.CharactorOutlineScale, RSdest.CharactorOutlineScale, destFactor);

        LightDir = RSdest.LightDir;

        CharactorGrayScale  = Mathf.Lerp(RSsource.CharactorGrayScale, RSdest.CharactorGrayScale, destFactor);
        CharactorBrightness = Mathf.Lerp(RSsource.CharactorBrightness, RSdest.CharactorBrightness, destFactor);
        CharactorContrast   = Mathf.Lerp(RSsource.CharactorContrast, RSdest.CharactorContrast, destFactor);

        CharactorFinalColor = Color.Lerp(RSsource.CharactorFinalColor, RSdest.CharactorFinalColor, destFactor);

        CharactorSpecularIntensity = Mathf.Lerp(RSsource.CharactorSpecularIntensity, RSdest.CharactorSpecularIntensity, destFactor);
        CharactorSpecularGloss     = Mathf.Lerp(RSsource.CharactorSpecularGloss, RSdest.CharactorSpecularGloss, destFactor);


        EnvGlobalLightDiffuse  = Color.Lerp(RSsource.EnvGlobalLightDiffuse, RSdest.EnvGlobalLightDiffuse, destFactor);
        EnvGlobalLightSpecular = Color.Lerp(RSsource.EnvGlobalLightSpecular, RSdest.EnvGlobalLightSpecular, destFactor);;
        EnvGlobalLightScale    = Color.Lerp(RSsource.EnvGlobalLightScale, RSdest.EnvGlobalLightScale, destFactor);;
        EnvGlobalLightRotation = Vector3.Lerp(RSsource.EnvGlobalLightRotation, RSdest.EnvGlobalLightRotation, destFactor);

        EnvGlobalSkyBoxColor = Color.Lerp(RSsource.EnvGlobalSkyBoxColor, RSdest.EnvGlobalSkyBoxColor, destFactor);
        EnvGlobalGlassColor  = Color.Lerp(RSsource.EnvGlobalGlassColor, RSdest.EnvGlobalGlassColor, destFactor);
        EnvGlobalTColor      = Color.Lerp(RSsource.EnvGlobalTColor, RSdest.EnvGlobalTColor, destFactor);

        EnvironmentCubemap       = RSdest.EnvironmentCubemap;
        EnvironmentBlurryCubemap = RSdest.EnvironmentBlurryCubemap;

        FogColor       = Color.Lerp(RSsource.FogColor, RSdest.FogColor, destFactor);
        FogDistStart   = Mathf.Lerp(RSsource.FogDistStart, RSdest.FogDistStart, destFactor);
        FogDistEnd     = Mathf.Lerp(RSsource.FogDistEnd, RSdest.FogDistEnd, destFactor);
        FogHeightStart = Mathf.Lerp(RSsource.FogHeightStart, RSdest.FogHeightStart, destFactor);
        FogHeightEnd   = Mathf.Lerp(RSsource.FogHeightEnd, RSdest.FogHeightEnd, destFactor);

        PlanarReflectionClearMode        = RSdest.PlanarReflectionClearMode;
        PlanarReflectionCameraClearColor = RSdest.PlanarReflectionCameraClearColor;
        PlanarReflectionRamp             = RSdest.PlanarReflectionRamp;

        PostFXBloomBlur         = Mathf.Lerp(RSsource.PostFXBloomBlur, RSdest.PostFXBloomBlur, destFactor);
        PostFXBloomRamp         = Mathf.Lerp(RSsource.PostFXBloomRamp, RSdest.PostFXBloomRamp, destFactor);
        PostFXBloomColor        = Color.Lerp(RSsource.PostFXBloomColor, RSdest.PostFXBloomColor, destFactor);
        PostFXBloomIntensity    = Mathf.Lerp(RSsource.PostFXBloomIntensity, RSdest.PostFXBloomIntensity, destFactor);
        PostFXVignetteIntensity = Mathf.Lerp(RSsource.PostFXVignetteIntensity, RSdest.PostFXVignetteIntensity, destFactor);
        //EB.Debug.Log (RSsource.PostFXVignetteColor);
        PostFXVignetteColor      = Color.Lerp(RSsource.PostFXVignetteColor, RSdest.PostFXVignetteColor, destFactor);
        PostFXWarpIntensity      = Vector2.Lerp(RSsource.PostFXWarpIntensity, RSdest.PostFXWarpIntensity, destFactor);
        PostFXColourGradeTexture = RSdest.PostFXColourGradeTexture;
        if (RSdest.PostFXVignette2Mask != null || RSdest.PostFXVignette2Intensity == 0.0f)
        {
            PostFXVignette2MaskColor     = Color.Lerp(RSsource.PostFXVignette2MaskColor, RSdest.PostFXVignette2MaskColor, destFactor);
            PostFXVignette2Intensity     = Mathf.Lerp(RSsource.PostFXVignette2Intensity, RSdest.PostFXVignette2Intensity, destFactor);
            PostFXVignette2DarkIntensity = Mathf.Lerp(RSsource.PostFXVignette2DarkIntensity, RSdest.PostFXVignette2DarkIntensity, destFactor);
            PostFXVignette2Color         = Color.Lerp(RSsource.PostFXVignette2Color, RSdest.PostFXVignette2Color, destFactor);
            PostFXVignette2Mask          = RSdest.PostFXVignette2Mask;
        }
        else
        {
            PostFXVignette2Mask          = null;
            PostFXVignette2Color         = Color.white;
            PostFXVignette2DarkIntensity = 1.0f;
            PostFXVignette2Intensity     = 1.0f;
            PostFXVignette2MaskColor     = Color.black;
        }

        AdjustmentNoRelfScale      = RSdest.AdjustmentNoRelfScale;
        AdjustmentNoRelfOffset     = RSdest.AdjustmentNoRelfOffset;
        AdjustmentNoRelfSpecScale  = RSdest.AdjustmentNoRelfSpecScale;
        AdjustmentNoRelfSpecOffset = RSdest.AdjustmentNoRelfSpecOffset;

        EnvGlobalScale            = Mathf.Lerp(RSsource.EnvGlobalScale, RSdest.EnvGlobalScale, destFactor);
        CombatantScale            = Mathf.Lerp(RSsource.CombatantScale, RSdest.CombatantScale, destFactor);
        NonCombatantScale         = Mathf.Lerp(RSsource.NonCombatantScale, RSdest.NonCombatantScale, destFactor);
        IrrelevanceCombatantScale = Mathf.Lerp(RSsource.IrrelevanceCombatantScale, RSdest.IrrelevanceCombatantScale, destFactor);
        WaterTranscy = Mathf.Lerp(RSsource.WaterTranscy, RSdest.WaterTranscy, destFactor);
    }
Exemplo n.º 3
0
 public virtual void Clone(RenderSettingsBase toClone)
 {
     LightProbeOffset = toClone.LightProbeOffset;
     LightProbeScale  = toClone.LightProbeScale;
     LightProbeMax    = toClone.LightProbeMax;
 }
Exemplo n.º 4
0
 public abstract void ApplyBlend(RenderSettingsBase source, RenderSettingsBase dest, float destFactor);
Exemplo n.º 5
0
    private void SetShaderVar()
    {
        if (renderers == null)
        {
            return;
        }

        RenderSettingsBase setting = RenderSettingsManager.Instance.GetCurrentRenderSettings();

        if (mCurrLightDir == setting.LightDir && !needUpdateShader)
        {
            return;
        }

        needUpdateShader = false;

        if (this == null)
        {
            return;
        }

        if (setShaderTime >= TotalShaderTime)
        {
            return;
        }

        bool isCombat  = Hotfix_LT.UI.LTCombatEventReceiver.Instance == null ? false : Hotfix_LT.UI.LTCombatEventReceiver.Instance.Ready;
        bool isReadyUI = (bool)GlobalUtils.CallStaticHotfix("Hotfix_LT.UI.GlobalMenuManager", "GetCurrentWinFromILR");

        if (renderers.Length == 0)
        {
            setShaderTime++;
        }
        else
        {
            mCurrLightDir = setting.LightDir;
        }
        for (int i = 0; i < renderers.Length; i++)
        {
            Vector4 thisRotation = setting.GetLightDir();
            for (int j = 0; j < renderers[i].materials.Length; j++)
            {
                var mat = renderers[i].materials[j];
                mat.SetVector("_LightDir", thisRotation);

                if (isReadyUI)
                {
                    mat.DisableKeyword("EBG_RIM_MAP_ON");
                    mat.EnableKeyword("EBG_RIM_MAP_OFF");
                }
                else
                {
                    mat.EnableKeyword("EBG_RIM_MAP_ON");
                    mat.DisableKeyword("EBG_RIM_MAP_OFF");
                }
                if (isCombat)
                {
                    mat.SetFloat("_UseViewDir", 1.0f);
                }
                else
                {
                    mat.SetFloat("_UseViewDir", 0.0f);
                }
            }
        }
    }