Example #1
0
 public static void SetFallShaderGlobals(Map map)
 {
     if (GenPlant.FallIntensityOverride)
     {
         Shader.SetGlobalFloat(ShaderPropertyIDs.FallIntensity, GenPlant.FallIntensity);
     }
     else
     {
         Vector2 vector = Find.WorldGrid.LongLatOf(map.Tile);
         Shader.SetGlobalFloat(ShaderPropertyIDs.FallIntensity, GenPlant.GetFallColorFactor(vector.y, GenLocalDate.DayOfYear(map)));
     }
     Shader.SetGlobalInt("_FallGlobalControls", (!GenPlant.FallGlobalControls) ? 0 : 1);
     if (GenPlant.FallGlobalControls)
     {
         Shader.SetGlobalVector("_FallSrc", new Vector3(GenPlant.FallSrcR, GenPlant.FallSrcG, GenPlant.FallSrcB));
         Shader.SetGlobalVector("_FallDst", new Vector3(GenPlant.FallDstR, GenPlant.FallDstG, GenPlant.FallDstB));
         Shader.SetGlobalVector("_FallRange", new Vector3(GenPlant.FallRangeBegin, GenPlant.FallRangeEnd));
     }
 }
Example #2
0
        public static void LogFallColorForYear()
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.AppendLine("Fall color amounts for each latitude and each day of the year");
            stringBuilder.AppendLine("---------------------------------------");
            stringBuilder.Append("Lat".PadRight(6));
            for (int i = -90; i <= 90; i += 10)
            {
                stringBuilder.Append((i.ToString() + "d").PadRight(6));
            }
            stringBuilder.AppendLine();
            for (int j = 0; j < 60; j += 5)
            {
                stringBuilder.Append(j.ToString().PadRight(6));
                for (int k = -90; k <= 90; k += 10)
                {
                    stringBuilder.Append(GenPlant.GetFallColorFactor((float)k, j).ToString("F3").PadRight(6));
                }
                stringBuilder.AppendLine();
            }
            Log.Message(stringBuilder.ToString(), false);
        }