Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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
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
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 · 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
  • 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.

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

Angry Bots 4.0 ground reflection/shader error (Unity 4.1.2f1) 0 Answers

Is it possible to change the shader of collision bodies in editor? 1 Answer

Outline shader being shown only in the material editor 1 Answer

Differences in Depth Buffer inside the editor and outside the editor 1 Answer

Shader Intellisense / Code completion 2 Answers


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