Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


RemoveVariant

Remove ShaderVariantCollection.ShaderVariant and associated graphics states from collection.
Read time 2 minutesLast updated 4 days ago

Definition

RemoveVariant(Shader, PassIdentifier, LocalKeyword[])

Remove ShaderVariantCollection.ShaderVariant and associated graphics states from collection.
public bool RemoveVariant(Shader shader, PassIdentifier passId, LocalKeyword[] keywords)

Parameters

shader

Shader used in the variant.

PassIdentifier used in the variant.

LocalKeyword array of keywords used in the variant.

Returns

Type

Description

boolTrue if successfully removed, false otherwise.

Remarks

If only the
material
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
globalKeywords
.

RemoveVariant(Material, PassIdentifier)

Remove ShaderVariantCollection.ShaderVariant and associated graphics states from collection.
public bool RemoveVariant(Material mat, PassIdentifier passId)

Parameters


PassIdentifier used in the variant.

Returns

Type

Description

boolTrue if successfully removed, false otherwise.

Remarks

If only the
material
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
globalKeywords
.

RemoveVariant(Material, PassIdentifier, GlobalKeyword[])

Remove ShaderVariantCollection.ShaderVariant and associated graphics states from collection.
public bool RemoveVariant(Material mat, PassIdentifier passId, GlobalKeyword[] globalKeywords)

Parameters


PassIdentifier used in the variant.

globalKeywords

GlobalKeyword array of global keywords used in the variant.

Returns

Type

Description

boolTrue if successfully removed, false otherwise.

Remarks

If only the
material
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
globalKeywords
.