// lightUpRoutine:
 // 0: PointLight;  1: DirectionalLight;
 // 2: SpotLight;
 // 3: XSpotLight;  4: NXSpotLight;
 // 5: YSpotLight;  6: NYSpotLight;
 // 7: ZSpotLight;  8: NZSpotLight;
 /// <summary>
 ///
 /// </summary>
 /// <param name="light"></param>
 /// <param name="program"></param>
 public static void SetBlinnPhongUniforms(this LightBase light, ShaderProgram program)
 {
     if (light is PointLight)
     {
         SetUniforms(light as PointLight, program);
     }
     else if (light is DirectionalLight)
     {
         SetUniforms(light as DirectionalLight, program);
     }
     else if (light is SpotLight)
     {
         SetUniforms(light as SpotLight, program);
     }
     else if (light is TSpotLight)
     {
         SetUniforms(light as TSpotLight, program);
     }
     else
     {
         throw new System.Exception(string.Format("Not expected light type:[{0}].", light.GetType()));
     }
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="light"></param>
 /// <returns></returns>
 public static mat4 GetViewMatrix(this LightBase light)
 {
     if (light is TSpotLight)
     {
         return(GetViewMatrix(light as TSpotLight));
     }
     else if (light is DirectionalLight)
     {
         return(GetViewMatrix(light as DirectionalLight));
     }
     else if (light is SpotLight)
     {
         return(GetViewMatrix(light as SpotLight));
     }
     else
     {
         throw new System.Exception(string.Format("Not expected light type:[{0}].", light.GetType()));
     }
 }