Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


EnableKeyword

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

Definition

EnableKeyword(GlobalKeyword)

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

Parameters

The global or local shader keyword to enable.

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.

EnableKeyword(Material, LocalKeyword)

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

Parameters

material

The material on which to enable the local shader keyword.

The global or local shader keyword to enable.

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.

EnableKeyword(ComputeShader, LocalKeyword)

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

Parameters

computeShader

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

The global or local shader keyword to enable.

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.

EnableKeyword(RayTracingShader, LocalKeyword)

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

Parameters

rayTracingShader

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

The global or local shader keyword to enable.

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.