I have a script that draws up a reference to a shader by name via Shader.Find(), and it displays fine in the editor, yet when I build it for the web player OR standalone PC the object displays in solid pink. Thus it appears that the builder doesn’t know it needs to be included in your build. Is there a way to mark it to be force-included?
Nothing to do with 3.5; the shader needs to be included somehow that forces it to be part of the build. It’s in your project, so it will always work in the editor. Finding things with strings won’t do it, since it’s very hard to tell what all possible combinations are. i.e., Shader.Find("foobar"); could be done as var a = "foo"; var b = "bar"; Shader.Find(a+b);. So Shader.Find won’t cause a shader to be included, since Unity doesn’t know it’s being referred to. Instead, use the shader in a material on some object that’s in the scene, or use it in a material that’s in the Resources folder, since everything in Resources is always included whether it’s used or not.
Solved as per a related post by placing the shader asset in Assets/Resources, which ensures it gets included in builds even when not directly linked to.
The new answer for Unity 2017:
Shaders can be forced included using Project Settings>Graphics>“Always Include Shaders”