Common Mistakes
Reducing build size
Tips to improve build times:
-
Enable “Strip All” under Optimize Unity Post Processing Build to remove most shader variants from Unity post processing (if you are using only Beautify, this option is very useful).
-
Enable “Automatically Strip Unused Features” or manually strip the effects that you won’t use by editing BeautifyCore.shader file (see next section).
Manually setting shader keywords/features
Edit BeautifyCore.shader file and search any line starting with #pragma multi_compile_local. For example:
#pragma multi_compile_local __ BEAUTIFY_TONEMAP_ACES
This line will generate 2 variants of the shader. One that use the ACES tonemapper and other that doesn’t.
A way to reduce shader variants involves setting manually the shader keyword:
-
If your game uses the ACES feature, you can just replace that line with:
#define BEAUTIFY_TONEMAP_ACES 1
-
If your game does not use the ACES feature at all, you can just remove completely that line (or keyword if there’re more keywords in the same line).
List of keywords used:
BEAUTIFY_TONEMAP_ACES | Uses the custom ACES tonemapper |
BEAUTIFY_LUT | Uses LUT (color look-up texture) option |
BEAUTIFY_NIGHT_VISION | Night vision effect |
BEAUTIFY_BLOOM | Bloom effect |
BEAUTIFY_BLOOM_USE_DEPTH | Used to attenuate bloom with depth |
BEAUTIFY_BLOOM_USE_LAYER | Used by the option to apply bloom only to specific layers |
BEAUTIFY_ANAMORPHIC_FLARES_USE_DEPTH | Used by the option to apply anamorphic flares only to specific layers |
BEAUTIFY_DIRT | Lens dirt effect |
BEAUTIFY_DEPTH_OF_FIELD | Depth of field effect |
BEAUTIFY_DOF_TRANSPARENT | Special treatment to transparent objects with depth of field |
BEAUTIFY_CHROMATIC_ABERRATION | Chromatic aberration effect |
BEAUTIFY_PURKINJE | Purkinje effect |
BEAUTIFY_VIGNETTING | Vigenette effect |
BEAUTIFY_VIGNETTING_MASK | Texture-mask vignette |
BEAUTIFY_EYE_ADAPTATION | Eye adaptation effect |
BEAUTIFY_OUTLINE | Outline effect |
BEAUTIFY_COLOR_TWEAKS | Color adjustments listed under Tonemapping and Color Grading section in the inspector |
BEAUTIFY_TURBO | Uses faster shader code |
BEAUTIFY_DITHER | Dithering effect |
BEAUTIFY_SHARPEN | Sharpen effect |
Important! Please note that:
-
All these keywords are defined as “local keyword” meaning that they don’t count towards the total of 256 maximum global keywords.
-
Any modification to BeautifyCore.shader will be lost when updating the asset to a newer version. Remember to apply the same modifications after updating.