# SetShaderPassEnabled(string, bool)

> Enables or disables a Shader pass on a per-Material level.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.7/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public void SetShaderPassEnabled(string passName, bool enabled)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Shader pass name (case insensitive).**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Flag indicating whether this Shader pass should be enabled.

### Remarks

By default, all Shader passes are enabled. This function allows a Material to treat a specific Shader pass (as indicated by LightMode pass tag) as if it does not exist in the Shader. For example, if the Shader has a "refraction" pass but you only want to enable it on Materials that have a refraction Texture assigned, pass "refraction" as `passName` and false for `enabled` for Materials without a refraction Texture assigned.

Additional Resources: [Material.GetShaderPassEnabled](/engine/6000.7/script-reference/unityengine/material/getshaderpassenabled.md), RenderLoop, Shader pass tags.
