Esempio n. 1
0
        public static void ConfigureSCPEFog()
        {
            RefreshShaderFilePaths();

            EditorUtility.DisplayProgressBar("Stylized Water 2", "Modifying shader...", 1f);
            {
                ToggleCodeBlock(FogLibraryFilePath, "UnityFog", false);
                ToggleCodeBlock(FogLibraryFilePath, "Enviro", false);
                ToggleCodeBlock(FogLibraryFilePath, "Azure", false);
                ToggleCodeBlock(FogLibraryFilePath, "AtmosphericHeightFog", false);
                ToggleCodeBlock(FogLibraryFilePath, "SCPE", true);

                //multi_compile keyword
                ToggleCodeBlock(ShaderFilePath, "UnityFog", false);
                ToggleCodeBlock(ShaderFilePath, "AtmosphericHeightFog", false);
                ToggleCodeBlock(TessellationFilePath, "UnityFog", false);
                ToggleCodeBlock(TessellationFilePath, "AtmosphericHeightFog", false);

                string libraryFilePath = AssetDatabase.GUIDToAssetPath(SCPE_LIBRARY_GUID);
                if (libraryFilePath == string.Empty)
                {
                    Debug.LogError("SCPE fog shader library could not be found with GUID " + SCPE_LIBRARY_GUID + ". This means it was changed by the author. Please notify me!");
                }
                SetIncludePath(FogLibraryFilePath, "SCPE", libraryFilePath);
            }
            EditorUtility.ClearProgressBar();

            CurrentFogConfiguration = FogConfiguration.SCPostEffects;
            Debug.Log("Shader file modified to use " + CurrentFogConfiguration + " fog rendering");
        }
Esempio n. 2
0
        public static void GetCurrentFogConfiguration()
        {
            FogConfiguration config;

            FogConfiguration.TryParse(GetConfiguration(FogLibraryFilePath), out config);

            CurrentFogConfiguration = config;
        }
Esempio n. 3
0
        public static void ConfigureUnityFog()
        {
            RefreshShaderFilePaths();

            EditorUtility.DisplayProgressBar("Stylized Water 2", "Modifying shader...", 1f);
            {
                ToggleCodeBlock(FogLibraryFilePath, "UnityFog", true);
                ToggleCodeBlock(FogLibraryFilePath, "Enviro", false);
                ToggleCodeBlock(FogLibraryFilePath, "Azure", false);
                ToggleCodeBlock(FogLibraryFilePath, "AtmosphericHeightFog", false);
                ToggleCodeBlock(FogLibraryFilePath, "SCPE", false);

                //multi_compile keyword
                ToggleCodeBlock(ShaderFilePath, "UnityFog", true);
                ToggleCodeBlock(ShaderFilePath, "AtmosphericHeightFog", false);
                ToggleCodeBlock(TessellationFilePath, "UnityFog", true);
                ToggleCodeBlock(TessellationFilePath, "AtmosphericHeightFog", false);
            }
            EditorUtility.ClearProgressBar();

            CurrentFogConfiguration = FogConfiguration.UnityFog;
            Debug.Log("Shader file modified to use " + CurrentFogConfiguration + " fog rendering");
        }
Esempio n. 4
0
 public static void SetFogConfiguration(FogConfiguration config)
 {
     if (config == FogConfiguration.UnityFog)
     {
         ConfigureUnityFog();
     }
     if (config == FogConfiguration.Enviro)
     {
         ConfigureEnviroFog();
     }
     if (config == FogConfiguration.Azure)
     {
         ConfigureAzureFog();
     }
     if (config == FogConfiguration.AtmosphericHeightFog)
     {
         ConfigureAtmosphericHeightFog();
     }
     if (config == FogConfiguration.SCPostEffects)
     {
         ConfigureSCPEFog();
     }
 }