AddVariants(Material, int)
Adds one or more new shader variants to the collection.
Read time 1 minuteLast updated 13 days ago
Definition
- Type: Method
- Namespace: UnityEngine.Experimental.Rendering
- Assembly: UnityEngine.CoreModule
public bool AddVariants(Material mat, int subshaderIndex = -1)
Parameters
Returns
Type | Description |
|---|---|
| bool | True if at least one new variant was added, false otherwise. |
Remarks
If is not specified, then one ShaderVariantCollection.ShaderVariant will attempt to be added for each shader pass in every SubShader of the parameter's Shader. Otherwise, at most Shader.GetPassCountInSubshader number of variants will be added using the specified .
subshaderIndexmaterialsubshaderIndexAll generated shader variants will use the set of Material.enabledKeywords combined with the global shader keywords that are currently enabled in the active context.