Example #1
0
        public void CreateDefaultSettings(Material[] materials)
        {
            Settings = new ShaderControllerSettings
            {
                Heading                 = "Vegetation Studio Grass",
                Description             = "",
                LODFadePercentage       = false,
                LODFadeCrossfade        = false,
                SampleWind              = false,
                SupportsInstantIndirect = true,
                BillboardHDWind         = false
            };

            Settings.AddLabelProperty("Foliage settings");

            Settings.AddColorProperty("TintColor1", "Dry color tint", "",
                                      ShaderControllerSettings.GetColorFromMaterials(materials, "_Color"));
            Settings.AddColorProperty("TintColor2", "Healthy color tint", "",
                                      ShaderControllerSettings.GetColorFromMaterials(materials, "_ColorB"));

            Vector4 colorScale = ShaderControllerSettings.GetVector4FromMaterials(materials, "_AG_ColorNoiseArea");

            Settings.AddFloatProperty("TintAreaScale", "Tint area scale", "", colorScale.y, 10f, 150f);
            Settings.AddFloatProperty("RandomDarkening", "Random darkening", "", ShaderControllerSettings.GetFloatFromMaterials(materials, "_RandomDarkening"), 0, 1);
            Settings.AddFloatProperty("RootAmbient", "Root ambient", "", ShaderControllerSettings.GetFloatFromMaterials(materials, "_RootAmbient"), 0, 1);
            Settings.AddFloatProperty("AlphaCutoff", "Alpha cutoff", "", ShaderControllerSettings.GetFloatFromMaterials(materials, "_Cutoff"), 0, 1);
        }
Example #2
0
        public void CreateDefaultSettings(Material[] materials)
        {
            Settings = new ShaderControllerSettings
            {
                Heading                 = "Stylized Grass",
                Description             = "Description text",
                LODFadePercentage       = true,
                LODFadeCrossfade        = false,
                UpdateWind              = true,
                SampleWind              = true,
                DynamicHUE              = true,
                SupportsInstantIndirect = true
            };

            fadeParams = ShaderControllerSettings.GetVector4FromMaterials(materials, "_FadeParams");
            Settings.AddBooleanProperty("enableDistFade", "Distance fading", "", fadeParams.z == 1f ? true : false);
            Settings.AddFloatProperty("fadeStartDist", "Fade start", "", fadeParams.x, 0, 100);
            Settings.AddFloatProperty("fadeEndDist", "Fade end", "", fadeParams.y, 0, 500);

            Settings.AddLabelProperty(" ");

            Settings.AddLabelProperty("Color");
            Settings.AddColorProperty("_BaseColor", "Base color", "", ShaderControllerSettings.GetColorFromMaterials(materials, "_BaseColor"));
            Settings.AddColorProperty("_HueVariation", "Hue variation", "", ShaderControllerSettings.GetColorFromMaterials(materials, "_HueVariation"));
            Settings.AddFloatProperty("_ColorMapStrength", "Colormap strength", "", ShaderControllerSettings.GetFloatFromMaterials(materials, "_ColorMapStrength"), 0, 1);
            if (Shader.GetGlobalVector("_ColorMapUV").w == 0f)
            {
                Settings.AddLabelProperty("No color map is currently active");
            }
            Settings.AddFloatProperty("_ColorMapHeight", "Colormap height", "", ShaderControllerSettings.GetFloatFromMaterials(materials, "_ColorMapHeight"), 0, 1);

            //No support for vectors!
            //Settings.add("_HeightmapScaleInfluence", "Heightmap scale influence", "", ShaderControllerSettings.GetVector4FromMaterials(materials, "_HeightmapScaleInfluence"), 0, 1);

            Settings.AddFloatProperty("_OcclusionStrength", "Ambient Occlusion", "", ShaderControllerSettings.GetFloatFromMaterials(materials, "_OcclusionStrength"), 0, 1);
            Settings.AddFloatProperty("_VertexDarkening", "Random darkening", "", ShaderControllerSettings.GetFloatFromMaterials(materials, "_VertexDarkening"), 0, 1);
            Settings.AddFloatProperty("_Translucency", "Translucency", "", ShaderControllerSettings.GetFloatFromMaterials(materials, "_Translucency"), 0, 1);

            Settings.AddLabelProperty(" ");

            Settings.AddLabelProperty("Bending");
            Settings.AddBooleanProperty("_BendMode", "Per-vertex", "", ShaderControllerSettings.GetFloatFromMaterials(materials, "_BendMode") == 0 ? true : false);
            Settings.AddFloatProperty("_BendPushStrength", "Pushing", "", ShaderControllerSettings.GetFloatFromMaterials(materials, "_BendPushStrength"), 0, 1);
            Settings.AddFloatProperty("_BendFlattenStrength", "Flattening", "", ShaderControllerSettings.GetFloatFromMaterials(materials, "_BendFlattenStrength"), 0, 1);
            Settings.AddFloatProperty("_PerspectiveCorrection", "Perspective Correction", "", ShaderControllerSettings.GetFloatFromMaterials(materials, "_PerspectiveCorrection"), 0, 1);

            Settings.AddLabelProperty(" ");

            Settings.AddLabelProperty("Wind");
            Settings.AddFloatProperty("_WindAmbientStrength", "Ambient Strength", "", ShaderControllerSettings.GetFloatFromMaterials(materials, "_WindAmbientStrength"), 0, 1);
            Settings.AddFloatProperty("_WindSpeed", "Speed", "", ShaderControllerSettings.GetFloatFromMaterials(materials, "_WindSpeed"), 0, 10);
            Settings.AddFloatProperty("_WindVertexRand", "Vertex randomization", "", ShaderControllerSettings.GetFloatFromMaterials(materials, "_WindVertexRand"), 0, 1);
            Settings.AddFloatProperty("_WindObjectRand", "Object randomization", "", ShaderControllerSettings.GetFloatFromMaterials(materials, "_WindObjectRand"), 0, 1);
            Settings.AddFloatProperty("_WindRandStrength", "Random strength", "", ShaderControllerSettings.GetFloatFromMaterials(materials, "_WindRandStrength"), 0, 1);
            Settings.AddFloatProperty("_WindSwinging", "Swinging", "", ShaderControllerSettings.GetFloatFromMaterials(materials, "_WindSwinging"), 0, 1);
            Settings.AddFloatProperty("_WindGustStrength", "Gust Strength", "", ShaderControllerSettings.GetFloatFromMaterials(materials, "_WindGustStrength"), 0, 1);
            Settings.AddFloatProperty("_WindGustFreq", "Gust Frequency", "", ShaderControllerSettings.GetFloatFromMaterials(materials, "_WindGustFreq"), 0, 10);
            Settings.AddFloatProperty("_WindGustTint", "Gust Tint", "", ShaderControllerSettings.GetFloatFromMaterials(materials, "_WindGustTint"), 0, 1);
        }