Esempio n. 1
0
    public static float ShadowKernelRadius(SunshineShadowFilters filter)
    {
        switch (filter)
        {
        case SunshineShadowFilters.PCF2x2:
            return(1.414214f);

        case SunshineShadowFilters.PCF3x3:
            return(2.12132f);

        case SunshineShadowFilters.PCF4x4:
            return(2.828427f);
        }
        return(0.7071068f);
    }
Esempio n. 2
0
 public static float ShadowKernelRadius(SunshineShadowFilters filter)
 {
     switch (filter)
     {
     case SunshineShadowFilters.PCF2x2:
         return 1.414214f;
     case SunshineShadowFilters.PCF3x3:
         return 2.12132f;
     case SunshineShadowFilters.PCF4x4:
         return 2.828427f;
     }
     return 0.7071068f;
 }
Esempio n. 3
0
 /// <summary>
 /// Calculates the diagonal radius of a shadow filter kernel.
 /// </summary>
 /// <returns>
 /// The kernel radius.
 /// </returns>
 /// <param name='filter'>
 /// Filter.
 /// </param>
 public static float ShadowKernelRadius(SunshineShadowFilters filter)
 {
     // Sqrt(size^2 + size^2) / 2
     switch(filter)
     {
     case SunshineShadowFilters.PCF2x2:		return 1.414214f;
     case SunshineShadowFilters.PCF3x3:		return 2.12132f;
     case SunshineShadowFilters.PCF4x4:		return 2.828427f;
     //case ShadowFilters.PCF5x5:		return 3.535534f;
     //case ShadowFilters.PCF6x6:		return 4.24264f;
     //case ShadowFilters.PCF7x7:		return 4.949748f;
     //case ShadowFilters.PCF8x8:		return 5.656854f;
     //case ShadowFilters.PCF9x9:		return 6.363961f;
     case SunshineShadowFilters.Hard:
     default:						return 0.7071068f;
     }
 }
Esempio n. 4
0
 public static void SetFilterStyle(SunshineShadowFilters style)
 {
     SunshineKeywords.SetFilterStyle((int)(style + 1));
 }
Esempio n. 5
0
 public static void SetFilterStyle(SunshineShadowFilters style)
 {
     SunshineKeywords.SetFilterStyle((int)(style + 1));
 }