I added the Deferred Night Vision Effect script to my main camera and it works in the Unity GUI as you can see here:
But when I build the project and run the executable, I get the following:
I looked at the DeferredNightVisionEffect.cs (free Unity asset) and I cannot figure out why it’s working in the GUI but not in the executable. The error in output_log.txt is:
ArgumentNullException: Argument cannot be null.
Parameter name: mat
at (wrapper managed-to-native) UnityEngine.Graphics:Internal_BlitMaterial (UnityEngine.Texture,UnityEngine.RenderTexture,UnityEngine.Material,int,bool)
at UnityEngine.Graphics.Blit (UnityEngine.Texture source, UnityEngine.RenderTexture dest, UnityEngine.Material mat, Int32 pass) [0x00000] in <filename unknown>:0
at UnityEngine.Graphics.Blit (UnityEngine.Texture source, UnityEngine.RenderTexture dest, UnityEngine.Material mat) [0x00000] in <filename unknown>:0
at DeferredNightVisionEffect.OnRenderImage (UnityEngine.RenderTexture source, UnityEngine.RenderTexture destination) [0x00015] in [*project_root*]\Assets\Shaders\DeferredNV\DeferredNightVisionEffect.cs:117
(Filename: [*project_root*]/Assets/Shaders/DeferredNV/DeferredNightVisionEffect.cs Line: 117)
Any guidance appreciated, thanks in advance!