• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by CinnaMint · Feb 01, 2011 at 11:40 PM · shadereditorstandalone

Shader not working in Stand-Alone build, but works in Editor.

Stats: Unity 2.6 Windows Editor/Building

So, I've done some sniffing around, and I don't think anyone else seems to have this issue;

A shader I'm using (REPostProcessor/DreamBlurEffect) to blur the screen works perfectly fine in the Editor, I see it, I have access to it, etc.

But, when I make a full build and play it externally, the blur effect doesn't work. Is it possible for a shader only to work JUST in the Editor, and not work at all in a fully compiled game? The shader is there, I still have access to everything, so it's still tangible. It's effects are just not seen, is all.

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image yoyo · Feb 02, 2011 at 01:20 AM 2
Share

I had a similar problem for materials I was creating in code -- since I didn't have a reference to the shader in my scene, the shader had to be in the Resources folder or else it's not included in the build.

avatar image CinnaMint · Feb 03, 2011 at 05:48 PM 0
Share

This is also a great idea to check. A common mistake is to forget to put required files into the Resources folder. ($$anonymous$$y shader was attached to a Camera, so it was ok.), Regardless, I moved my shader to my Resources folder and re-compiled again. Still, the shader wasn't working. $$anonymous$$ind of a shame...

avatar image SevenUnearth · Aug 07, 2013 at 03:59 PM 0
Share

Does your shader is in a Resources folder?

8 Replies

· Add your reply
  • Sort: 
avatar image
-1
Best Answer

Answer by CinnaMint · Feb 18, 2011 at 11:11 PM

Ok, so I decided to give up on this.

I ended up upgrading my project to Unity3, and the Shader I was using ended up not being compatible in Unity 3, so I just abandoned that Shader altogether, and created a new one (With a Node based shader editor).

Never did figure it out, but when you can't figure things out, sometimes its best to move ahead with something else.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Julien-Lynge · Aug 29, 2011 at 04:24 PM 0
Share

I've had an error similar to yours, where a shader works in the editor but crashes when attempting to create a new material with it in the web or desktop player. I've also had issues with post effects (i.e. blur+bloom) working in the editor and not in the players.

I believe at least the shader issue could be due to an error I saw once when compiling and haven't been able to duplicate. Unity gave an error saying something like 'Unity has run out of shader keywords. Ignoring [name]'. If there are issues with the keyword namespace, that would explain why some shaders simply crash (silently).

avatar image
1

Answer by DaveA · Feb 01, 2011 at 11:44 PM

Check your quality settings. Is the default worse than what the Editor has set? What if you change your quality settings on stand-alone-startup?

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image CinnaMint · Feb 03, 2011 at 05:42 PM 0
Share

That was a very good suggestion actually! I did check all the settings, they were all set at "Good". So, for the sake of chance, I beefed up the Standalone quality to "Fantastic", still no-go. Thought maybe it was something to do with the fact I build my StandAlone through an Editor Code, but that wasn't it either. I'm going to check out Yoyo's comment. But thank you for the suggestion! It might help future people.

avatar image DaveA · Feb 03, 2011 at 06:05 PM 0
Share

Welcome. When you get it figured out, please post here

avatar image MonteyMontey · Jun 02, 2017 at 01:51 PM 0
Share

Thank you so much! It fixed my problem, I was already about to get insane because of that problem thanks!

avatar image
0

Answer by Exsanguinatus · Sep 07, 2011 at 04:43 PM

Actually, I'd try turning of the Anti-Aliasing. Someone where I work discovered that the shader I was having troubles with works if you lower the quality settings on the build, so I went through the settings, one by one, changing them from their defaults on 'Beautiful' quality to those on 'Good' quality, and the one that made the shader work was turning off AA. There's still issues, as I'm getting tearing on the edges of the polygons that are using the shader, but it's something to start with, at least.

Original Message: I'm also having this problem with Unity 3. Shader works fine in the editor, but not on build. No crashes... it just doesn't render. Render settings on build are identical to the editor, etc., and I can't find any reason for it breaking. I wish someone had a real answer.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by Mark-Davis · Oct 12, 2011 at 07:03 PM

Just found an answer to this! I had the same problem where an unreleased Voxelform shader would work in the editor, but not when running from the player.

Source of the problem:

 Properties {
         
     _WallDiffuse ("Wall Diffuse", 2D) = "white" {}
     _WallNormal ("Wall Normal", 2D) = "white" {}
     _WallSpecular ("Wall Specular", 2D) = "white" {}
 
     _FloorDiffuse ("Floor Diffuse", 2D) = "white" {}        
     _FloorNormal ("Floor Normal", 2D) = "white" {}
     _FloorSpecular ("Floor Specular", 2D) = "white" {}
 
     _NormalPower ("Normal Power", Float) = 1
     _SpecularPower ("Specular Power", Float) = 1
     _TriplanarFrequency ("Triplanar Frequency", Float) = .2
     _NoiseScale ("Noise Scale", Float) = 1.0
     _NoiseVal1 ("Noise Value 1", Float) = 1257787.0
     _NoiseVal2 ("Noise Value 2", Float) = 233.0
 
     }

The offending line is: _NoiseVal1 ("Noise Value 1", Float) = 1257787.0

Strangely, changing 1257787.0 to a smaller value such as 125778.0 fixes the problem. It also doesn't matter whether this property is even being used. So the cause wasn't somewhere else in the code. Wonder what's going on here? I'm guessing this won't fix everyone's problem, but at least we know there are some quirky differences between the editor and player.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ilya_ca · Mar 13, 2013 at 06:41 AM 1
Share

Had the same issue. Apparently very low values also cause issues (i.e. 0.0001).

avatar image chrismarch · Aug 25, 2015 at 08:03 PM 0
Share

I had a property with range(0.00001... that caused this problem. $$anonymous$$y editor is 64bit but build was 32bit. I wonder if that matters?

avatar image
0

Answer by Exsanguinatus · Oct 12, 2011 at 08:35 PM

Unfortunately, I don't know what's up with your shader... I did figure out what was happening on mine, though I entirely forgot I posted here with the problem so I never updated the post.

In my case, turns out that the anti-aliasing was what was breaking things. It wasn't causing issues in the editor because the editor seems to refuse to use anti-aliasing. Specifically, I had screwed up the render queue which, when confronted with anti-aliasing, completely failed to render. Transparency in the wrong queue will certainly make things go funny.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
  • 1
  • 2
  • ›

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

11 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Assetdatabase.Refresh is taking way too long 0 Answers

Why changing material shader at runtime also affect my asset on disk? 3 Answers

2sided Shader - Strumpy Shader Editor 1 Answer

Display material only in editor 2 Answers

How can I change default shader for new/imported objects? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges