ContainsVariant
Check if the specified ShaderVariantCollection.ShaderVariant exists in the collection.
Read time 2 minutesLast updated 10 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 .
materialglobalKeywordsAdditional 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
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 .
materialglobalKeywordsAdditional 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
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 .
materialglobalKeywordsAdditional Resources: GraphicsStateCollection.AddVariant, GraphicsStateCollection.RemoveVariant.