Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 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
3
Question by testure · Jun 05, 2011 at 10:35 PM · editorbuildpinkcustom-shader

Custom shader turns pink when built

Anybody know why this would happen? I have a simple Diffuse Outline shader that I found on the unity forums, and I'm swapping out the shader when I have a target selected, so the selected target has an outline. It works fine in the editor- but as soon as it's built, the shader stops working- instead of an outline around the target, the target turns pink- as if it's missing its diffuse texture.

Any idea what would cause this? I thought when you built binaries, it pulled in any needed resources.. if that's the case, it should be a 1:1 representation of what I get in the editor, but that's not the case. Any help on this would be appreciated!

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

4 Replies

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

Answer by testure · Jul 21, 2011 at 06:31 PM

Okay, so I finally got around to looking into this problem again- and it turned out to be something really simple. I was changing the shader via script, and the shader wasn't in my Resources folder like I thought it was. Moving the shader to resources fixed it, obviously :)

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
8

Answer by Coersum · Mar 07, 2014 at 02:14 AM

Another (better imo) way to do it, posted on the forums by *Kaspar Daugaard*, go to the Unity menu "Edit", then select "Project Settings", then go to "Graphics".

Expand "Always Included Shaders", then increase the "size" by 1, then click on the new element selection circle on its right and then select the shader you want to have loaded with your game.

Comment
Add comment · Show 4 · 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 Schimauscha · Oct 05, 2015 at 08:40 PM 0
Share

Awesome dude! :D This really made my day, was exactly what i needed thx.

avatar image czugalu · Jan 26, 2017 at 05:23 PM 0
Share

This should be the best answer

avatar image myddt · Jul 12, 2017 at 06:32 AM 0
Share

You save my day, completely solve my problem. Thank you.

avatar image Aeyos · Nov 22, 2017 at 01:10 AM 0
Share

I would french kiss you if I could, you just saved me hours of headbanging on the wall. $$anonymous$$udos!

avatar image
1

Answer by Paulius-Liekis · Jun 07, 2011 at 08:58 AM

In theory it should work as you described. You get pink shader when it's unabled to find shader or compile it. Check log after running your build and see if there are any indications what went wrong with your shader.

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 testure · Jun 07, 2011 at 02:13 PM 0
Share

there are no indications in the log that anything went wrong at all.. just the typical non platform assembly notifications that say "(this message is harmless)"

avatar image Hesta · Jul 05, 2013 at 04:18 PM 0
Share

I'm having the exact same problem, can you please tell me how did you move the shader exactly?

avatar image
0

Answer by ozitech · Feb 16, 2017 at 01:58 PM

First make a backup of your project then Delete all folder other than Assets in your project folder then run your project it will take time , then you must have to change platform then make a build and run. It will work 100% sure IA .. Sorry for my bad English :)

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

10 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

Related Questions

Distribute terrain in zones 3 Answers

Pink screen in editor and some games, why? 2 Answers

Is there an event triggered before editor starts rebuilding scripts? 1 Answer

Build Standalone (.exe) with google cardboard VR. 1 Answer

Texture Glitch 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