RemoveVariant
Remove ShaderVariantCollection.ShaderVariant and associated graphics states from collection.
Read time 2 minutesLast updated 4 days ago
Definition
- Type: Method
- Namespace: UnityEngine.Rendering
- Assembly: UnityEngine.CoreModule
RemoveVariant(Shader, PassIdentifier, LocalKeyword[])
Remove ShaderVariantCollection.ShaderVariant and associated graphics states from collection.
public bool RemoveVariant(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 successfully removed, false otherwise. |
Remarks
If only the is provided, then this function will only remove a shader variant matching exactly the set of Material.enabledKeywords combined with the global shader keywords that are currently enabled in the active context, unless they are explicitly provided via .
materialglobalKeywordsAdditional Resources: GraphicsStateCollection.RemoveGraphicsStatesForVariant, GraphicsStateCollection.ContainsVariant.
RemoveVariant(Material, PassIdentifier)
Remove ShaderVariantCollection.ShaderVariant and associated graphics states from collection.
public bool RemoveVariant(Material mat, PassIdentifier passId)
Parameters
Returns
Type | Description |
|---|---|
| bool | True if successfully removed, false otherwise. |
Remarks
If only the is provided, then this function will only remove a shader variant matching exactly the set of Material.enabledKeywords combined with the global shader keywords that are currently enabled in the active context, unless they are explicitly provided via .
materialglobalKeywordsAdditional Resources: GraphicsStateCollection.RemoveGraphicsStatesForVariant, GraphicsStateCollection.ContainsVariant.
RemoveVariant(Material, PassIdentifier, GlobalKeyword[])
Remove ShaderVariantCollection.ShaderVariant and associated graphics states from collection.
public bool RemoveVariant(Material mat, PassIdentifier passId, GlobalKeyword[] globalKeywords)
Parameters
Returns
Type | Description |
|---|---|
| bool | True if successfully removed, false otherwise. |
Remarks
If only the is provided, then this function will only remove a shader variant matching exactly the set of Material.enabledKeywords combined with the global shader keywords that are currently enabled in the active context, unless they are explicitly provided via .
materialglobalKeywordsAdditional Resources: GraphicsStateCollection.RemoveGraphicsStatesForVariant, GraphicsStateCollection.ContainsVariant.