Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


RemoveVariant

Remove ShaderVariantCollection.ShaderVariant and associated graphics states from collection.
Read time 1 minuteLast updated 13 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.

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.

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.