In this lesson, you will learn how to fine-tune the Unreal Engine asset cooker to minimize runtime memory footprints and maximize load speeds by tailoring data serialization and compression to your target hardware.
Precision Cooker Configuration
When you cook your project for a specific platform (e.g., PS5, Xbox Series X, or high-end PC), the default settings are often overly generalized. To achieve high-performance deployment, you must force the cooker to prioritize hardware-specific features like ASTC or BC7 compression for textures and stripped shader permutations for your specific target architecture.
Optimizing Texture and Shader Pipelines
The cooker is responsible for converting your source assets into the binary formats your target platform’s GPU can digest natively. If you are shipping to mobile or modern consoles, global settings often waste cycles or memory. You can override these in your DefaultEngine.ini or via Platform-Specific Game Settings.
For example, to ensure your texture streaming pool and compression formats are optimized for high-end hardware, you can restrict the cooker from including unnecessary high-resolution mips or uncompressed data:
[/Script/UnrealEd.ProjectPackagingSettings]
bBuildCooked=True
bCookAll=False
bCompressedCookedPackages=True
By enabling bCompressedCookedPackages, the cooker uses Zlib or Oodle compression on serialized data, significantly reducing your game's footprint on the storage medium. However, you must balance this against CPU decompression overhead. For high-end hardware, you should prefer Oodle’s faster throughput settings.
Stripping Unused Shader Permutations
Shader compilation is a major bottleneck during the cooking process. You can drastically reduce both package size and load times by editing your DefaultEngine.ini to exclude specific shader features that your project doesn't utilize:
[DevOptions.Shaders]
bAllowZeroTriangleMeshDrawCalls=False
bUseShaderCaching=True
By strictly managing the TargetPlatform settings, you prevent the cooker from compiling redundant code for rendering features (like standard shadow maps if you are exclusively using Virtual Shadow Maps) that your project will never trigger. This results in leaner .ushaderbytecode files and a much more responsive engine state at runtime.
Key Takeaway: Optimizing the asset cooker is about surgical removal—stripping unused shader permutations and forcing platform-native texture compression ensures your final build is perfectly tuned to your hardware's specific bandwidth and memory constraints.