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 /
avatar image
2
Question by thenelson · Sep 28, 2011 at 05:14 AM · androidtextureterrain

Terrain Texture Black on Android

Now that terrain is supported on Unity android, I've been working on a project. When I manually created my terrain, everything worked perfect both on computer and android.

I switched to dynamically generated terrain, and populated the terrain with splatPrototypes. It works perfectly on the computer, but on android the terrain is simply solid black. I am thinking perhaps this has to do with not having a Basemap texture? I can't seem to find a way to apply it in the code. Or maybe there is some other issue that I am missing. Any suggestions would be welcome.

I have included the section of code where I attach the textures:

 // add terrain textures
 
 var splats = new SplatPrototype[1];
     splats[0] = new SplatPrototype();
     splats[0].texture = Resources.Load("grass");
     splats[0].tileSize = new Vector2(15,15);
     splats[0].tileOffset = new Vector2(0,0);
 
 myTerrainData.splatPrototypes = splats;
 var myTerrain = Terrain.CreateTerrainGameObject(myTerrainData);
 myTerrain.transform.Translate(-terrainRes/2,0,-terrainRes/2);

I've tried using EDT texture compression instead of the default but that hasn't helped.

Comment
Add comment · Show 1
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 thenelson · Sep 28, 2011 at 07:35 PM 0
Share

A bit of an update: I manually placed a terrain with the texture on it into my scene. When I loaded it again, both the manually placed terrain and the dynamically placed were textured. Could it be that the texture is not being included in the resources since it hasn't been attached to anything? How would I fix this?

However, when I placed a simple cube into the scene with the grass texture, that did not place the texture on the terrain also. I am very confused here.

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by thenelson · Sep 30, 2011 at 01:59 AM

Well this isn't exactly a solution so much as a workaround, but I ended up placing a terrain object into the scene manually which had the texture on it. When it is present, the dynamically created terrain then has the texture also.

I just keep my manually created terrain in the scene but give it minimum size and place it below the new terrain.

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 ThePilgrim · Nov 06, 2013 at 04:04 PM 0
Share

Thank you for posting this work around. I was having the exact same problem, except for on a PC build. I am creating and texturing my terrain through a script. Everything would work perfectly fine when I would play the game from the editor. However, when I would build the game and play it, the terrain and terrain details would be completely black.

Adding a single terriain manually, and giving it a texture and a detail grass with texture fixed it all for me.

avatar image I-am-Lawrence · Mar 04, 2016 at 04:48 AM 0
Share

As of 03/03/2016 this is still a problem. I dynamically generate new terrain and texture prototypes, and when exporting and executing a build, the textures are missing and the terrain is black. What confuses me is all of the textures are referenced through script, but they still fail to be exported or load.

$$anonymous$$anually creating a terrain and $$anonymous$$ANUALLY adding the textures solved this problem for me. I tried to load the textures onto the manually created terrain through script and after building it looked like Bill Cosby's sweater, so even worse than plain black. It's a shame that this workaround is still needed because it's wasted overhead and an extra step when adding any other textures to the dynamic terrain. Very disappointing that this is still an issue.

avatar image
1

Answer by Arcoder · Mar 02, 2015 at 03:08 AM

My solution was to change Texture import settings to Advanced with "Read/Write" enabled. That forces unity to include texture even when its not used at start of game.

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Texture problem android 0 Answers

Odd Ground ( terrain ) texture appearance 0 Answers

Terrain Texture Problem 0 Answers

Unity Terrain texture issue on android device 1 Answer

Incorporating Unity textures, models, and terrain into Eclipse 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