Skip to content

Format

typescript
Material.DisableKeyword(value)

class: Material

Description

Disables the local shader keyword for this material.

This method can be used to disable a specific keyword at runtime, effectively turning off certain functionality related to that keyword in the shader. When a keyword is disabled, the associated code block will not be compiled and executed, reducing unnecessary computations and optimizing rendering performance.

Parameters

param_nametypedescription
valuestring

Return

typedescription
void

Code Example

typescript
let material = Resources.Load<Material>(Material, "materialId");
material.DisableKeyword("keyword");