コード例 #1
0
 /// <summary>
 /// Get cache size in bytes.
 /// </summary>
 /// <param name="nbElement"></param>
 /// <param name="resolution">Atlas resolution (square).</param>
 /// <param name="hasMipmap">Atlas uses mip maps.</param>
 /// <param name="format">Atlas format.</param>
 /// <returns></returns>
 public static long GetApproxCacheSizeInByte(int nbElement, int resolution, bool hasMipmap, GraphicsFormat format)
 => (long)(nbElement * resolution * resolution * (double)((hasMipmap ? k_MipmapFactorApprox : 1.0f) * GraphicsFormatUtility.GetBlockSize(format)));