ContainsVariant
Check if the specified ShaderVariantCollection.ShaderVariant exists in the collection.
Read time 2 minutesLast updated 7 days ago
Definition
- Type: Method
- Namespace: UnityEngine.Rendering
- Assembly: UnityEngine.CoreModule
ContainsVariant(Shader, PassIdentifier, LocalKeyword[])
Check if the specified ShaderVariantCollection.ShaderVariant exists in the collection.
public bool ContainsVariant(Shader shader, PassIdentifier passId, LocalKeyword[] keywords)
Parameters
Shader used in the variant.
PassIdentifier used in the variant.
LocalKeyword array of keywords used in the variant.
Returns
Type | Description |
|---|---|
| bool | True if variant exists in collection, false otherwise. |
Remarks
If only the is provided, then this function will check for a shader variant using the set of Material.enabledKeywords combined with the global shader keywords that are currently enabled in the active context, unless explicitly provided via .
matglobalKeywordsAdditional Resources: GraphicsStateCollection.AddVariant, GraphicsStateCollection.RemoveVariant.
ContainsVariant(Material, PassIdentifier)
Check if the specified ShaderVariantCollection.ShaderVariant exists in the collection.
public bool ContainsVariant(Material mat, PassIdentifier passId)
Parameters
Material with the shader and enabled keywords used in the variant.
PassIdentifier used in the variant.
Returns
Type | Description |
|---|---|
| bool | True if variant exists in collection, false otherwise. |
Remarks
If only the is provided, then this function will check for a shader variant using the set of Material.enabledKeywords combined with the global shader keywords that are currently enabled in the active context, unless explicitly provided via .
matglobalKeywordsAdditional Resources: GraphicsStateCollection.AddVariant, GraphicsStateCollection.RemoveVariant.
ContainsVariant(Material, PassIdentifier, GlobalKeyword[])
Check if the specified ShaderVariantCollection.ShaderVariant exists in the collection.
public bool ContainsVariant(Material mat, PassIdentifier passId, GlobalKeyword[] globalKeywords)
Parameters
Material with the shader and enabled keywords used in the variant.
PassIdentifier used in the variant.
GlobalKeyword array of global keywords used in the variant.
Returns
Type | Description |
|---|---|
| bool | True if variant exists in collection, false otherwise. |
Remarks
If only the is provided, then this function will check for a shader variant using the set of Material.enabledKeywords combined with the global shader keywords that are currently enabled in the active context, unless explicitly provided via .
matglobalKeywordsAdditional Resources: GraphicsStateCollection.AddVariant, GraphicsStateCollection.RemoveVariant.