|
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?
(comments are locked)
|
|
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., Looks like we were posting answers at the same time. Good call.
Mar 01 '12 at 03:32 AM
blitzen
(comments are locked)
|
|
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. Where are the built-in shader assets? Can you get at them without downloading their source code? The way I typically get built-in shaders into my project is by assigning them to materials that I don't actually use, and them putting those materials into a Resources folder. There must be a better way?
May 02 at 01:08 PM
shavais
(comments are locked)
|

(I tried to edit the question with this new realization but it seems the forum is broken and won't apply editing changes.)
I have a script that draws up a reference to the shader by name via Shader.Find(), and so that is the only reference to it from the program - 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?
keep ur shader in resource folder it will be included no matter wat happens