Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
4
Question by barbe63 · Jun 08, 2015 at 10:50 AM · shaderload

Shader not working in build

Hi,

My game have the ability to change the shaders on the run but here goes the problem: When I build in for my mobile the shaders doesn't seems to load at all.

I already put all the shaders I need in a resources folder with no success, I even tried to put some spheres with the shaders to force the import.

Strange things to note:

-If i build only a level the shaders work fine but if I build with the starting menu it doesn't when I load the first level.

-When I print the name of the shader it is using it's the good one (a toon shader) but the rendering looks like it's a diffuse.

What could it be? Some of you guys already encoutered a similar issue?

Thanks.

Edit: I found that half of it is working actually. The instantiated materials don't change while the others do.

   foreach(GameObject npc in npcs)
             {
                 npc.GetComponent<Human>().deadSkin.shader=Shader.Find("Toon/Basic Outline Alpha"); // this works
                 npc.GetComponentInChildren<SkinnedMeshRenderer>().sharedMaterial.shader=Shader.Find("Toon/Lighted Outline"); // this doesn't
                 npc.GetComponentInChildren<SkinnedMeshRenderer>().sharedMaterial.color=new Color(0.55f, 0.55f, 0.55f, 1f);
 }

I tried with both material and sharedMaterial methods. Again this works if I built the level only but then with LevelLoad it does not.

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
22
Best Answer

Answer by tanoshimi · Jun 08, 2015 at 12:27 PM

Go Settings -> Graphics, and add the shaders you need to the "Always Included Shaders" list.

Comment
Add comment · Show 7 · 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 barbe63 · Jun 08, 2015 at 01:03 PM 0
Share

That solved my issue. Thanks a ton! Weirdly enough I have a new one now with one of my shaders being pink and showing warnings on it saying it won't compile. It was working before?! Trying to fix it...

Thanks again!

Edit: I had also to include shaders that were used in Pass in the shader I use.

avatar image bravo075 · Dec 21, 2016 at 03:53 AM 0
Share

Dude I love you, was scratching my head with this for quite a while.

avatar image OTOBURJA · Nov 27, 2018 at 09:03 PM 0
Share

DUUDE I JUST LOVE YOU!! SAVED $$anonymous$$Y LIFE!!!!! <3 <3 <3

avatar image mxoconnell · Sep 01, 2019 at 07:51 AM 0
Share

Settings --> graphics? What menu is that under?

avatar image vivekboss99 mxoconnell · Nov 14, 2019 at 02:53 PM 1
Share

edit>project settings>graphics

avatar image FoxAdventures · Aug 29, 2021 at 11:05 PM 0
Share

still saving lives 6 years later

Show more comments
avatar image
0

Answer by tang64gaming · Jun 12, 2020 at 01:53 PM

Hello, I have the same issue still when i put my shader into "Always Included Shaders". If some1 can help me, my project is on android and I use a custom shader which is just a standart with "cull off".

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

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

28 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Why is my shader not being saved on to the object? 0 Answers

Making the Specular map separate in a shader (not as alpha)? 2 Answers

How to force the compilation of a shader in Unity? 5 Answers

Eliminate CPU spike from shader load? 1 Answer

AssetBundle.Load on Shader object returns null 0 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