Before publishing an effect you should experiment with different compression settings, so you can make your overall project size as small as possible. A smaller project size can improve the overall impressions that your effect gets.
Any compression you apply in Spark AR Studio won't affect your original files.
In Spark AR Studio, you can either:
We recommend adjusting compression for individual textures, rather than changing the global settings. Any changes made to individual textures will override the global settings.
Whether you're adjusting settings for individual textures or globally, you can choose between using Smart Compression, or manual compression.
In this guide, you'll learn about:
To test the appearance and performance of your effects after applying compression, mirror your effect to a device using the Spark AR Player app.
It's also worth taking a look at our guide to optimizing effects, for other techniques to help reduce the size of your effect.
Smart Compression automatically chooses the best type of compression for each texture, and for all devices - according to the image's contents. You can adjust Smart Compression to apply more, or less, compression. It's best to experiment with Smart Compression before adjusting settings manually.
Manual compression allows you to choose different compression settings for the different bundles exported by Spark AR Studio.
To see and adjust the compression settings for individual textures:
To see and adjust global compression settings:
You'll see these options:
However you adjust the compression settings, you'll be able to see the results in the Simulator.
If you're manually changing the compression options, make sure the Device Type reflects the compression setting you're testing. For example, if you've checked the box next to Override iOS, make sure the Device Type is set to an iOS device.
To do this, click the dropdown under Device Type in the Toolbar:
You can find which textures are taking up a lot of space in the the Asset Summary. You can then decide where reducing texture size and applying compression will have the most impact.
To see the Asset Summary:
You'll see a screen that looks like this:
You'll see the sizes of assets across the 3 bundles Spark AR Studio generates:
You'll see both downloaded and unpacked bundles. Downloaded bundles are the zipped up files that get downloaded to a device. Unpacked bundles are the unpacked files, ready to be displayed.
You can also see the size of each texture when it's select in the Assets panel. The file sizes for downloaded and unpacked bundles are listed under Image Size.
You can also see which assets aren't being used in your effect in the Asset Summary. Removing these assets can improve performance.
Assets that are being used in the effect have a tick next to them under the In Use column. If assets are referenced in a script, they won't be shown as In use.
Remove any assets that don't have a tick next to them - unless you know they're referenced in a script. In the example above, we'd remove Old_Texture.
To remove an asset:
If there are any gaps in the table, click Compress All. This will compress your effects and tell you the size of all your assets.
It's worth experimenting with different texture sizes/resolution settings:
To do this, either:
To apply Smart Compression to a texture:
You'll be able to see how your effect looks with compression applied in the Simulator. You'll see the impact on the size of the texture in the Inspector panel, under Texture Sizes:
We recommend leaving the global options as they are, and reducing the size of individual assets instead. However, changing them can be useful if an effect is intended for lower end devices or areas of low connectivity.
To change the global smart compression settings, go to Project Properties in the Menu.
To use manual compression, either:
The compression options are the same, whether you're changing the global settings or settings for individual textures.
Limit the size of the texture. You can't make the size of the texture bigger than the original, unless you're stretching an image to make it square.
The following compression options are available for iOS devices:
Depending on the type of texture you're compressing, some methods will look better than others. Selecting PVRTC_V1 (Automatic) will choose the best method for your texture depending on whether you have an Alpha channel or not.
The highest accuracy setting usually results in better quality effects, but it will take longer to calculate the compression. We recommend using Highest, because it doesn't effect the file size.
Check this box to help remove banding in some images, especially those with gradients.
Change the size of the texture.
The following compression options are available for Android devices:
Depending on the type of texture you're compressing, some methods will look better than others. Selecting ETC2 (Automatic) will choose the best method for your texture, depending on whether you have an Alpha channel or not.
The following options are available for this compression scheme:
The highest accuracy setting usually results in better quality effects, but it will take longer to calculate the compression. For basic bundles, accuracy settings effect file size.
Removing all alpha channels can quickly bring an effect size down.
For ETC2 formats, select Punch Through Alpha. This is half the size of an ETC2_RGBA - so you'll need to test it to make sure your effect looks okay.
If a texture with an alpha channel isn't appearing as expected, check you're using RGBA, rather than RGB.
For PVR formats, you can try overriding large textures to 2BPP rather than 4BPP formats. Use Highest Accuracy, as 2BPP textures can look poor.
For Basic bundles, set the format to PNG and Quality to Medium or Lowest. This will reduce the PNG to a 256-color variant which should save space, but loose some quality. Set Method to Best to get the tightest compression.
Blocked compressed textures improve performance.
This is because block compressed textures are loaded as raw data and decompressed by the GPU during rendering. GPU has dedicated hardware to decompress these textures. Given these compressed textures reduce bandwidth, it's generally faster for the GPU to decompress block compressed textures than to load raw uncompressed textures.