Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by ramanpreet9 · Nov 10, 2016 at 12:24 PM · texturebuild and run

textures white/grey after build and run

i have a few images that i am using to texture some planes. The planes render perfectly fine in unity. but as soon as i build and run, they were initially all white. After some googling, i saw someone post something about materials, i changed my shader to "Legacy Shaders/Diffuse Detail" . Now i see some grey some white some brown planes instead (not the correct textures). i am also setting the scale as: mr.material.SetTextureScale("_MainTex", new Vector2(-1, 1));

images to show the issue: from build and run: alt text

from unity: alt text

i am not sure whats wrong. Any suggestions are welcome

image-from-exe.png (100.2 kB)
image-from-unity.jpg (291.5 kB)
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 Desoxi · Nov 10, 2016 at 12:36 PM 0
Share

Is you project working at all with any other textures on a standard plane or cube etc.?

avatar image ramanpreet9 Desoxi · Nov 10, 2016 at 12:43 PM 0
Share

I read somewhere that unity needs at least one material to render textures. I was generating everything via script file so i didnt have any materials manually created. So, i added a cube and created a material and assigned it red color. after building and running. it works!

now i have a red cube sitting in my app somewhere haha.

avatar image Desoxi ramanpreet9 · Nov 10, 2016 at 01:19 PM 0
Share

For which platform are you building your project?

3 Replies

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

Answer by Desoxi · Nov 10, 2016 at 12:53 PM

Hahaha yeah, great app indeed! :D

But yes, unity needs a material and a mesh renderer (like it is used in the cube you created) & a Mesh filter to actually render your object. The Mesh filter has a reference to the actual mesh with its vertices etc. The Mesh Renderer needs a reference to the material(s) you want to use. So you have to add the created material to the mesh renderer in the corresponding gameobject . If no renderer is present, just create one or add it to you prefab which you are instantiating.

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 GermiyanBey · Dec 09, 2019 at 01:09 PM 0
Share

I have the same issue and you did not understand the problem, which this issue cannot be reduced to $$anonymous$$esh Renderer-$$anonymous$$aterial reference, but everything is fine in the Unity (a ready game I prepared I can say) and almost all models are devoid of materials on Build.

I suspect a shader error which I had added Built-in Shaders and then removed them from the project and since that time this problem appears.

avatar image
0

Answer by GermiyanBey · Dec 09, 2019 at 01:11 PM

I have the same issue after I added Built-in Shaders and then removed them from the project and Build and Run, and since that time this problem appears.

Thus I suspect a shader error instead of a simple Mesh Renderer-Material reference loss in contrary to the other suggestion here.

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 Sebas10PSG · Mar 19, 2020 at 10:25 AM

alt text I had to enable the Read/Write on the sprite and it fixed it for me


sprite-read-write.png (24.4 kB)
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

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

Related Questions

how to make terrain in 2D game? 0 Answers

Texture Strange Behaviour 0 Answers

Apparent Memory Leak during texture change 0 Answers

how to get a model with one material and one textuer 0 Answers

How to load a folder of textures automatically to an array of Raw Images? 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