Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


DisableKeyword

Adds a command to disable a global or local shader keyword.
Read time 2 minutesLast updated 5 days ago

Definition

DisableKeyword(GlobalKeyword)

Adds a command to disable a global or local shader keyword.
public void DisableKeyword(in GlobalKeyword keyword)

Parameters

The global or local shader keyword to disable.

Remarks

Shader keywords determine which shader variants Unity uses. For information on working with local shader keywords and global shader keywords and how they interact, see Using shader keywords with C# scripts.

DisableKeyword(Material, LocalKeyword)

Adds a command to disable a global or local shader keyword.
public void DisableKeyword(Material material, in LocalKeyword keyword)

Parameters

material

The material on which to disable the local shader keyword.

The global or local shader keyword to disable.

Remarks

Shader keywords determine which shader variants Unity uses. For information on working with local shader keywords and global shader keywords and how they interact, see Using shader keywords with C# scripts.

DisableKeyword(ComputeShader, LocalKeyword)

Adds a command to disable a global or local shader keyword.
public void DisableKeyword(ComputeShader computeShader, in LocalKeyword keyword)

Parameters

computeShader

The compute shader for which to disable the local shader keyword.

The global or local shader keyword to disable.

Remarks

Shader keywords determine which shader variants Unity uses. For information on working with local shader keywords and global shader keywords and how they interact, see Using shader keywords with C# scripts.

DisableKeyword(RayTracingShader, LocalKeyword)

Adds a command to disable a global or local shader keyword.
public void DisableKeyword(RayTracingShader rayTracingShader, in LocalKeyword keyword)

Parameters

rayTracingShader

The ray tracing shader for which to disable the local shader keyword.

The global or local shader keyword to disable.

Remarks

Shader keywords determine which shader variants Unity uses. For information on working with local shader keywords and global shader keywords and how they interact, see Using shader keywords with C# scripts.