I’m pretty new to writing shaders in HLSL, and after some trial and error I got a color replacement shader working. It just turns red pixels black when a bool is set to true. It works perfectly fine in the game view.
I would like to have the shader to work in edit mode, but I can’t get it to work.
The shader is added to the camera via a C# script:
[ExecuteInEditMode]
public class ShaderHandler : MonoBehaviour
{
public Material material;
private void OnRenderImage(RenderTexture source, RenderTexture destination)
{
Graphics.Blit(source, destination, material);
}
}
Is there a way to get OnRenderImage to run in edit mode? I’m using the standard render pipeline.