Here’s my code
public class TestOpengl : MonoBehaviour
{
private Material MyShader = null;
[HideInInspector]
public Texture2D MyImage;
public Texture2D DefaultImage;
You should never use Shader.Find() unless you’re 100% sure the shader is being included in the build.
Shaders not referenced directly or indirectly by any object in at least one scene included in the build will be stripped away. Same applies to all Unity assets (materials, textures, models, etc). Attempting to use a shader which doesn’t exist will result in pink (invalid) shading at runtime.
You can force Unity to include a shader in the build by adding it to “always included shaders”: