• 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
7

Answer by AndySum · Jan 12, 2014 at 04:28 AM

I had a lot of problems with some screenshaders not working, but I managed to fix it after a combination of problems. My shaders would work in the editor but when I built the standalone game they didn't appear at first, and then once I'd "fixed" that problem my screen was black.

Firstly, if your shader doesn't appear at all when you build the game, it might be because Unity can't find it. This will happen if you use Shader.Find() to locate your shaders. Put your shaders in the Assets/Resources folder to force them to be included. Alternatively modify your script with a reference to the shader itself instead of getting it with Shader.Find().

Next, if your screen is coming up black or otherwise not working, it may be because you're trying to blit a material directly which for some reason simply doesn't work. The solution I found in this thread: http://answers.unity3d.com/questions/275630/graphicsblit-with-custom-shader-gives-black-screen.html

As a workaround, you simply need to render your effect to an intermediate buffer and then Blit to the destination without a material. It only takes a couple of extra lines.

I hope this helps anyone looking at this problem in the future!

(Using Unity 4.3.1f1)

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 huseyinakcan · Mar 08, 2017 at 10:32 AM 0
Share

I had a similar problem with my screen shader using Unity 5.5.0f3. I was using Shader.Find, and putting the shader in Assets/Resources as suggested fixed my problem. Thank you.

avatar image
0

Answer by dscroggi · Mar 03, 2012 at 03:22 PM

One time I set an Object's tag to 'Editor Only' without knowing that it wouldn't even run in a build. Possible solution.

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
0

Answer by Monops · Jan 28, 2012 at 06:51 PM

I have a very similar problem: I cannot use ANY custom shader, not even the default one you get creating a shader: it will render black playing the game. I tried all your suggestions but no luck.

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 rabbitfang · Jan 29, 2012 at 04:58 AM 0
Share

Please don't bump such an old answered question unless you have useful something to add. Ins$$anonymous$$d please make a new question with a link pointing here saying that this solution did not work.

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