Skip to main content
Version: 2.2.x

Shader Variant Collection

Learn how to collect shader variants.

image

Click the "Collect Variants" button to start the collection process. Please wait patiently until it finishes.

Note: After the collection is complete, you need to configure the generated shadervariants file in the collection interface (AssetBundle Collector).

Jenkins Support

public static void CollectSVC()
{
string savePath = ShaderVariantCollectorSettingData.Setting.SavePath;
System.Action completedCallback = () =>
{
ShaderVariantCollection collection =
AssetDatabase.LoadAssetAtPath<ShaderVariantCollection>(savePath);
if (collection != null)
{
Debug.Log($"ShaderCount : {collection.shaderCount}");
Debug.Log($"VariantCount : {collection.variantCount}");
}
else
{
throw new Exception("Failed to Collect shader Variants.");
}

EditorTools.CloseUnityGameWindow();
EditorApplication.Exit(0);
};
ShaderVariantCollector.Run(savePath, completedCallback);
}
// Command line invocation
%Projects_UnityEngine_Path% -batchmode -projectPath %Projects_UnityProject_Path% -executeMethod ET.CIHelper.CollectSVC -logFile %Projects_UnityProject_Path%/Logs/CIBuildSVC.log