![]() Using ChunkBasedCompression has comparable loading times to uncompressed bundles with the added benefit of reduced size on disk. LZ4 uses a chunk based algorithm which allows the AssetBundle be loaded in pieces or “chunks.” Decompressing a single chunk allows the contained assets to be used even if the other chunks of the AssetBundle are not decompressed. Uncompressed AssetBundles are 16-byte aligned.īuildAssetBundleOptions.ChunkBasedCompression: This bundle option uses a compression method known as LZ4, which results in larger compressed file sizes than LZMA but does not require that entire bundle is decompressed, unlike LZMA, before it can be used. However, the load times once downloaded will be much faster. The downside to being uncompressed is the larger file download size. If you download and store the bundle through other means, you can recompress it with the AssetBundle.RecompressAssetBundleAsync API.īuildAssetBundleOptions.UncompressedAssetBundle: This bundle option builds the bundles in such a way that the data is completely uncompressed. LZMA compressed asset bundles loaded through UnityWebRequestAssetBundle are automatically recompressed to LZ4 compression and cached on the local file system. Using LZMA compression is only recommended for the initial download of an AssetBundle from an off-site host due to the smaller file size. ![]() Packaging all assets for a character or scene are some examples of bundles that might use this. This is best used when a bundle contains assets such that to use one asset from the bundle would mean all assets are going to be loaded. Once the bundle has been decompressed, it will be recompressed on disk using LZ4 compression which doesn’t require the entire bundle be decompressed before using assets from the bundle. It is worth noting that when using this BuildAssetBundleOptions, in order to use any assets from the bundle the entire bundle must be uncompressed initially. This results in the smallest possible file size but a slightly longer load time due to the decompression. LZMA compression requires that the entire bundle is decompressed before it’s used. See in Glossary:īuildAssetBundleOptions.None: This bundle option uses LZMA Format compression, which is a single compressed LZMA stream of serialized data files. See Texture Compression, Animation Compression, Audio Compression, Build Compression. While you’re free to combine BuildAssetBundleOptions as needs change and arise, there are three specific BuildAssetBundleOptions that deal with AssetBundle Compression A method of storing data that reduces the amount of storage space it requires. See Scripting API Reference on BuildAssetBundleOptions for a table of all the options. There are several different BuildAssetBundleOptions that you can specify that have a variety of effects. You can change this to any output directory you desire, just ensure that the folder actually exists before you attempt a build. Let’s dive a little deeper into what we’re actually saying.Īssets/AssetBundles: This is the directory that the AssetBundles will be output to. In the documentation on the AssetBundle Workflow, we have a code sample which passes three arguments to the BuildPipeline.BuildAssetBundles function. A recommended, and more user friendly, alternative is to use the Addressables package. Note: This section describes the creation of AssetBundles using the built-in BuildPipeline.BuildAssetBundles() API.
0 Comments
Leave a Reply. |