Documentation

Unity Engine

Download Unity

Unity Engine

SetReplacementShader(Shader, string)

Make the camera render with shader replacement.
Read time 1 minuteLast updated 6 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
Warning
Deprecated. Camera.SetReplacementShader is deprecated and will be removed in a future release. Shader replacement is supported only by the Built-In Render Pipeline, which is deprecated. To render objects with a different shader, use a ScriptableRenderPass with DrawingSettings.overrideShader in the Universal Render Pipeline instead. #from(6000.7)
public void SetReplacementShader(Shader shader, string replacementTag)

Parameters

shader


replacementTag

Remarks

SetReplacementShader
is deprecated and will be removed in a future release. Shader replacement is supported only by the Built-In Render Pipeline, which is deprecated. To render objects with a different shader, use a ScriptableRenderPass with DrawingSettings.overrideShader in the Universal Render Pipeline instead.
For more information, refer to Rendering with Replaced Shaders.
If the replacementTag argument is not in use, pass an empty string as the value.
After calling this function, camera will render its view with shader replacement. Call Camera.ResetReplacementShader to reset it back to normal rendering.