UDN
Search public documentation:
MobileLoadTimesAndInstallPackageSize
中国翻译
한국어
Interested in the Unreal Engine?
Visit the Unreal Technology site.
Looking for jobs and company info?
Check out the Epic games site.
Questions about support via UDN?
Contact the UDN Staff
한국어
Interested in the Unreal Engine?
Visit the Unreal Technology site.
Looking for jobs and company info?
Check out the Epic games site.
Questions about support via UDN?
Contact the UDN Staff
Mobile Load Times and Installed Package Size
Document Summary: Common methods to help reduce application load time and final install size for mobile applications. Document Changelog: Initial creationOverview
Load Times
Shaders
Shader Keys
Shaders on mobile platforms in UE3 are distinguished by their unique shader key. Please see the writeup contained within MobileMaterialReference for a description of this implementation. Reducing the number of shader keys is not a simple matter of reducing the total material count in your application, as materials can produce a varying number of keys based on a the specific material settings.Reducing Shader Keys
Mobile Shader Analyzer
The MobileShaderAnalyzer tool can help assess how many shader keys your application is generating, what materials they were generated from, and how to alter your materials to reduce them. Refer to the link above for information on the usage of this tool.Iterated Keys
As mentioned in the documentation for the MobileShaderAnalyzer, often materials will iterate multiple versions of some settings since the engine does not know how they will be used. By explicitly informing the engine of your intention with these materials, you can remove many of the iterated versions from your application:- Skinning. If you see both skinned and non-skinned iterations of shaders that you know will ALWAYS be used on skinned meshes, you can add the material to your application’s DefaultEngine.ini, under the MobileMaterialCookSettings section. Add a ‘+SkinningOnlyMaterials=
’ line under this section. During cook only the skinned version of this shader will be created, instantly halving the number of keys created by this material. Example:
[MobileMaterialCookSettings] +SkinningOnlyMaterials=M_FireChest +SkinningOnlyMaterials=M_IceChest
- Fog. The engine will generate unfogged and fogged versions of shaders if fogging is enabled for your title, rendering using the unfogged shader dynamically when possible for performance reasons. If your application can afford the performance hit of always using the fogged version of the shader, you can disable this shader iteration by setting bMobileMinimizeFogShaders=true under the [SystemSettings] section in your application’s DefaultSystemSettings.ini
- Particle settings. There are many particle settings that force iteration of an on/off state within the shaders. If you see toggling of any key settings that you aren’t making use of, disable that feature in the material.
Material Instance Constants
An excellent way to minimize shader key creation is to make use of master materials and material instance constants (MICs) as much as possible. Altering MICs in a child material will generally not add any new permutations to the shader keys created from the master material. Authoring your content from the start with master materials is a good way to avoid an explosion in shader keys later in the project. See the MaterialInstanceConstant page for more information.Additional Shader Keys Considerations
Shader Groups
Shader groups do not help eliminate shader keys, but can be of use by deferring subsets of key warming to other points within the application. The most common example is map loading. You can quickly create a shader group for each level in your app, the cooker will then add all keys for that map to its own shader group, and automatically warm these keys upon load of the level. This will raise your map load times by some amount, but generally lower your overall application loading time significantly. Per-map shader groups are created through the Engine.ini file under the MobileShaderGroups section like so:[Engine.MobileShaderGroups] .ShaderGroup=MyGroup .Package=MyMapName
Commandlet->AddDynamicMobileShaderGroup(FName(*GroupName), FName(*PkgFilename));
GMobileShaderInitialization.StartCompilingShaderGroup(FName(*ShaderGroupName), TRUE);
Unwarmed Keys
Note that there may be instances where some shader keys are not automatically warmed by the engine, generally the case if 3rd party software is tied into the engine rendering pipeline. You can manually add keys to be warmed at startup by including them within your DefaultEngine.ini file as such:[Engine.StartupShaderKeys] .Key=0x1980000000_0x3000000000000000
Boot Time Profiling
Refer to ProfilingBasics for tips on profiling boot times.Application Size
IPA Viewer (iOS)
IPAExamine /?
IPAExamine <full path to your ipa file>
Examining Cooked Data
Helpful Commandlets
PkgInfo
To examine the contents of your cooked packages (.xxx files), you can use the PkgInfo commandlet, as detailed in the CommandletList page. For example, the output of the command:Gamename.exe PkgInfo <path to package> -exports –simple –platform=<platform> > myfile.txt