Find the ShaderVariantCollection and GraphicsStateCollection in the project and exclude unregistered variants from the build. You can change the behaiour in the settings window ( "UTJ/ShaderVariantStrip" ).
Please use version 2.
Set to perform strip processing or not.
Specify whether to log which variants are included and which are excluded during the build process. Specify whether you want to keep a log of which variants were included and which were excluded.
It will be written to the directory "ShaderVariants/Builds/Timestamps" under the project.
This can be done even if Stripping is disabled.
There was a possibility that the log timestamp was not reset properly when building consecutively.
If you find that the log timestamps are not updated properly during continuous build, please press this button.
When enabled, Shaders that are not in the ShaderVariantCollection/GraphicsStateCollection will be deleted all Variants. When disabled, shaders that are not in the ShaderVariantCollection/GraphicsStateCollection is not performed by any special strip processing.
If all variants in Pass are deleted, at least one variant will be retained. If Pass becomes empty, Fallback will not be triggered and drawing will be skipped, so we have provided an option for this case.
Enabling this feature will remove the IPreprocessShaders under the "Unity." or "UnityEngine.".( such as Universal RenderPipeline. )
If Strict Variant Stripping is not enabled, you cannot use this feature.
*It's implemented by rewriting IL code.
You can debug which Shader keywords are enabled at which Stage.
If disabled, ShaderVariantCollection within the project will be ignored.
The ShaderVariantCollection asset specified here will be ignored.
If disabled, GraphicsStateCollection within the project will be ignored.
Only consider GraphicsStateCollections created with the same Graphics API as the build target.
Only consider GraphicsStateCollection created on the same platform as the build target.
The GraphicsStateCollection assets specified here will be excluded and ignored.
This option collects mismatched ShaderVariants from DevelopmentBuild with “Strict shader variant matching” enabled in PlayerSettings and creates a dummy GraphicsStateCollection.
Connect to the target for DevelopmentBuild.
Press this button to generate GraphicsStateCollection under Assets/GraphicsStateCollection/MissMatchVarint.
To display this button, you need to add “STRIP_ENABLE_AUTO_GSC” to Define. <br/ >
When the button is pressed, the GraphicsStateCollection that has been traced since the connected Player started up is transferred to the Editor.
GraphicsStateCollection cannot trace multiple objects simultaneously, so we have introduced options using Define.
This uses the removal of scriptable shader variants.
https://blogs.unity3d.com/jp/2018/05/14/stripping-scriptable-shader-variants/
In incremental builds, IPreprocessShaders.OnPorocessShader may not be called.
https://docs.unity3d.com/6000.0/Documentation/Manual/incremental-build-pipeline.html
If this occurs, please try CleanBuild.
This is a proposal for building a GraphicsStateCollection to improve strip processing.
1. First, disable Strip in this tool, create a Development build with “STRIP_ENABLE_AUTO_GSC” defined. 2. After running for a while, retrieve the GraphicsStateCollection from the Player. 3. Then, enable PlayerSettings.strictShaderVariantMatching, enable this tool, enable StrictVariantStripping and SafeMode in Common settings, and create a Development Build. 4. Collect Shader Variant mismatches using “Create GraphicsStatesCollection from Miss Match Variant.” I recommend collecting and building the GraphicsStateCollection in this manner. For the final build, enable SafeMode/StrictVarinatStripping in this tool and disable "PlayerSettings.StrictVariantStripping" for safety considerations. ※Enabling StrictVarinatStripping reduces the memory usage of unused shaders, such as fallback shaders.



