Exemple #1
0
        public void Export(STGenericTexture texture, TextureExportSettings settings, string filePath)
        {
            List <Surface> surfaces = texture.GetSurfaces(settings.ArrayLevel, settings.ExportArrays);

            var format = texture.Platform.OutputFormat;

            ASTC atsc = new ASTC();

            atsc.Width     = texture.Width;
            atsc.Height    = texture.Height;
            atsc.Depth     = texture.Depth;
            atsc.BlockDimX = (byte)TextureFormatHelper.GetBlockWidth(format);
            atsc.BlockDimY = (byte)TextureFormatHelper.GetBlockHeight(format);
            atsc.BlockDimZ = (byte)TextureFormatHelper.GetBlockDepth(format);
            atsc.DataBlock = ByteUtils.CombineArray(surfaces[0].mipmaps.ToArray());
            atsc.Save(new System.IO.FileStream(filePath, System.IO.FileMode.Create, System.IO.FileAccess.ReadWrite));
        }
        public uint GetBlockHeight()
        {
            var format = Platform.OutputFormat;

            return(TextureFormatHelper.GetBlockHeight(format));
        }