Shader not working properly when building

I am using a shader in post-processing for outlines. In the editor it looks great, but when I build the game (to Windows 86-64) it does not work properly. It seems like there is some sort of outlining, but not even close to the way it works in the editor.
All materials in the scene are using unlit materials if that makes any difference.

Editor:

Build:

The dot in the middle and text are UI elements. The blue object is not apart of the shader.

Already tried:
Making an object with a material using the shader
Putting shaders in the resource folder
Having shaders under ‘always included shaders’
Having shaders in preloaded shaders
Changing API to directx11, OpenGLCore, Vulkan

Using 2019.4.21f1 LTS with the built-in deferred renderer

Shader: Shader Outline - Pastebin.com
Shader from: https://roystan.net/articles/outline-shader.html

Edit: Looking into the shader guide it seems like it is the normal outline part which isn’t working properly.

Post Processing settings:

Any ideas what the cause of this might be?

Fixed it!
I had to disable “Optimize Mesh Data” in the Player settings

1 Like

I am also noticing this bug in 2021.2.16f1 on android, a shader works in editor but doesn’t show in the build because I am not using it on any models I am using it on the UI canvas it must not search there. I’ll file a bug for this and share the case no. back.

Add it to the always includes assets or shaders