ドキュメント

Unity Engine

Unity Engine

SetKeyword

Adds a command to set the state of a global or local shader keyword.
読み終わるまでの所要時間 2 分最終更新 1ヶ月前

Definition

SetKeyword(GlobalKeyword, bool)

Adds a command to set the state of a global or local shader keyword.
public void SetKeyword(in GlobalKeyword keyword, bool value)

Parameters

The local or global shader keyword to set the state for.

value

The state to set the shader keyword state to.

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.

SetKeyword(Material, LocalKeyword, bool)

Adds a command to set the state of a global or local shader keyword.
public void SetKeyword(Material material, in LocalKeyword keyword, bool value)

Parameters

material

The material for which to set the state of the local shader keyword.

The local or global shader keyword to set the state for.

value

The state to set the shader keyword state to.

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.

SetKeyword(ComputeShader, LocalKeyword, bool)

Adds a command to set the state of a global or local shader keyword.
public void SetKeyword(ComputeShader computeShader, in LocalKeyword keyword, bool value)

Parameters

computeShader

The compute shader for which to set the state of the local shader keyword.

The local or global shader keyword to set the state for.

value

The state to set the shader keyword state to.

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.

SetKeyword(RayTracingShader, LocalKeyword, bool)

Adds a command to set the state of a global or local shader keyword.
public void SetKeyword(RayTracingShader rayTracingShader, in LocalKeyword keyword, bool value)

Parameters

rayTracingShader

The ray tracing shader for which to set the state of the local shader keyword.

The local or global shader keyword to set the state for.

value

The state to set the shader keyword state to.

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.