RemoveVariant
Remove ShaderVariantCollection.ShaderVariant and associated graphics states from collection.
Read time 2 minutesLast updated 6 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 .
matglobalKeywordsAdditional 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
Material with the shader and enabled keywords used in the variant.
PassIdentifier 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 .
matglobalKeywordsAdditional 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
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 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 .
matglobalKeywordsAdditional Resources: GraphicsStateCollection.RemoveGraphicsStatesForVariant, GraphicsStateCollection.ContainsVariant.