- Home /
Unity 5 toon shaders don't work in Windows standalone build
I've had some problems with toon shaders not working properly or at all in Unity 5 standalone builds, and figured I'd test it out in a controlled environment. So I created a fresh Unity 5 project, imported everything from the Effects asset package, created a Cube in the scene and assigned a new material using the Toon/Lit Outline shader. This is what appears in the Editor:
However, I get this in a Windows Standalone build:
I also get
Shader 'Toon/Basic Outline': fallback shader 'Toon/Basic' not found
WARNING: Shader Unsupported: 'Toon/Basic Outline' - Setting to default shader.
Shader 'Toon/Basic Outline': fallback shader 'Toon/Basic' not found
WARNING: Shader Unsupported: 'Toon/Basic Outline' - Setting to default shader.
Setting up 1 worker threads for Enlighten.
Thread -> id: 2a70 -> priority: 1
in the output_log.txt of the build. The shaders are all certainly in the project in Standard Assets, so are the toon shaders broken in Unity 5 now? Although I can't get them to generate again, I was getting warnings saying
Fixed function TexGen used; it doesn't do anything now
for these shaders. I read that Unity took TexGen support out in Unity 5 because it was never used, yet their built-in shaders rely on it? Are there any fixes for this at all?
I can confirm the same thing seems to be happening with my $$anonymous$$ac and Windows builds using the same toon shader from the standard assets package.
Has someone found a solution to this problem yet? I tried silverscania's fix, however it didn't change anything for me. I found out that if you set the "Deferred" setting in the "Built-in-shader settings" section of the "Edit -> Project Settings -> Graphics" window to "No support" and then choose "Forward" as "Rendering path" in the "Other" section of the "Player settings", outlines are drawn properly, however I'm not sure if this is intended... I believe not but maybe someone with some more shader experience than me can help here...
Answer by silverscania · Apr 04, 2015 at 02:56 PM
I fixed this by commenting out line 43 in the outline shader 'ToonShading/Shaders/ToonBasicOutline.shader'
UsePass "Toon/Basic/BASE"
I'm using ToonLitOutline, which already includes the outline pass and ToonLit pass. So in that case I don't see the need for that line. But if you are using ToonBasicOutline then this will break it.
Answer by DizzyWascal · Aug 04, 2015 at 09:46 AM
I had this problem with my custom toon shaders. My fix was:
Make sure you have the correct #pragma target 3.0 or 5.0 for Dx11 in your custom shader code.
Made sure toon shaders standard package was properly downloaded and installed
Went to Edit - Project Settings -Graphics and in there is a list of shaders that you can drag and drop. I think its called built in shaders box. I just dragged the 4 standard toon shaders into it.
Lastly I created a "Resources" folder in the assets folder and copied and pasted my custom shaders into it. Didn't need to paste the standard toon shaders in it.
My build no longer has the problem with the outline and whole shader missing. Not sure if all these solutions will work for you but all 4 solutions was necessary for me.
I'm 80% sure solution 3 will do the trick because of your "Shader not found errors."
This worked for me as well (had to do all 4 steps, although there was nothing wrong with my standard assets installation). The weird part is although there are custom shaders in my project files, my outlines didn't stop working until I took those custom shaders OUT of my scenes. Anyway, thanks for the help.
Answer by Damurjin · Dec 20, 2015 at 11:19 AM
I also had a similar problem with the outline shader. I modified the outline width lower range to be 0.00001 and the standalone did not like that. I just changed that into a float and it all works fine now.
Your answer
Follow this Question
Related Questions
Transparent shader disappears with multiple objects 1 Answer
How to compare colors in Shaders? 2 Answers
How to force the compilation of a shader in Unity? 5 Answers
Difference between pos.z and pos.w? 0 Answers
Unity5 CG Shader get model position. 1 Answer