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 Anthony 5 · Apr 01, 2011 at 12:31 PM · shaderbuild

Shader not found in my application after build

Hi everyone,

I'm currently stucking on something relative to shaders.

In my scene, I'm adding a shader "Unlit/Transparent" (the one Unity is giving through the editor) to one of my cube (it's for a test) thanks to this script :

myCube.renderer.material.shader = Shader.Find("Unlit/Transparent");
myCube.renderer.material.mainTexture = Resources.Load(myImage) as Texture2D;

It works fine in the Unity Editor but when I'm lauching my built-in appplication, I'm having an error : my shader is not found.

I'm guessing it's a build settings problem (my shader is not exported ?).

Is anybody knowing what's going on ?

Any help would be appreciated. Thanks.

Regards.

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

1 Reply

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

Answer by efge · Apr 01, 2011 at 12:37 PM

From the reference:

When building a player, a shader will only be included if it is assigned to a material that is used in any scene or if the shader is placed in a "Resources" folder.

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 Anthony 5 · Apr 01, 2011 at 12:45 PM 0
Share

Ok so if I'm correctly understanding, my shader is not included because it is added at runtime. Because it's a Unity shader, am I able to include it manualy in my Resources folder (with a copy/paste for example) or do I have to re-create it (through UniSciTE)? (yeah, dumb question, but I'm a noob).

avatar image Anthony 5 · Apr 01, 2011 at 12:53 PM 0
Share

Well, I copy/pasted it width UniSciTE and it worked wery well.

Sorry for the noob question. Thanks anyway !

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

2 People are following this question.

avatar image avatar image

Related Questions

Distribute terrain in zones 3 Answers

How can I change the self ilumshader its emission value on a material from a script? 2 Answers

Only standard shader objects cast shadows in build. 0 Answers

What causes this build log message: "Shader import version has changed; will reimport all shaders..." 2 Answers

Unity 2018.1 green dots on screen [Windows] 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