DisableKeyword
Adds a command to disable a global or local shader keyword.
Read time 2 minutesLast updated 5 days ago
Definition
- Type: Method
- Namespace: UnityEngine.Rendering
- Assembly: UnityEngine.CoreModule
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.
Additional Resources: Shader variants and keywords, CommandBuffer.SetKeyword, CommandBuffer.EnableKeyword, GlobalKeyword, LocalKeyword, Shader.DisableKeyword, Material.DisableKeyword, ComputeShader.DisableKeyword, RayTracingShader.DisableKeyword.
DisableKeyword(Material, LocalKeyword)
Adds a command to disable a global or local shader keyword.
public void DisableKeyword(Material material, in LocalKeyword keyword)
Parameters
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.
Additional Resources: Shader variants and keywords, CommandBuffer.SetKeyword, CommandBuffer.EnableKeyword, GlobalKeyword, LocalKeyword, Shader.DisableKeyword, Material.DisableKeyword, ComputeShader.DisableKeyword, RayTracingShader.DisableKeyword.
DisableKeyword(ComputeShader, LocalKeyword)
Adds a command to disable a global or local shader keyword.
public void DisableKeyword(ComputeShader computeShader, in LocalKeyword keyword)
Parameters
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.
Additional Resources: Shader variants and keywords, CommandBuffer.SetKeyword, CommandBuffer.EnableKeyword, GlobalKeyword, LocalKeyword, Shader.DisableKeyword, Material.DisableKeyword, ComputeShader.DisableKeyword, RayTracingShader.DisableKeyword.
DisableKeyword(RayTracingShader, LocalKeyword)
Adds a command to disable a global or local shader keyword.
public void DisableKeyword(RayTracingShader rayTracingShader, in LocalKeyword keyword)
Parameters
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.
Additional Resources: Shader variants and keywords, CommandBuffer.SetKeyword, CommandBuffer.EnableKeyword, GlobalKeyword, LocalKeyword, Shader.DisableKeyword, Material.DisableKeyword, ComputeShader.DisableKeyword, RayTracingShader.DisableKeyword.