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 $$anonymous$$ · Nov 30, 2014 at 04:57 PM · terraintexture2dclonealphamap

Access terrain alphamaps directly? To clone them?

How do you clone a terrain's alphamap? It's inaccessible according to unity intellisense?

In case anyone reading this doesn't understand: setalphamaps() changes all clones of the terrain. Not just the terrain you use it on.

The Solution: Clone the alpha map.

The Problem: Can't access the alpha map's Texture2D object.

Hence this question being here.

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
1

Answer by Eric5h5 · Nov 30, 2014 at 05:05 PM

 TerrainData.GetAlphamaps

SetAlphamaps will only be applied to the terrain you use it on, as long as the terrain is an instance.

Comment
Add comment · Show 9 · 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 $$anonymous$$ · Nov 30, 2014 at 05:21 PM 0
Share

Took my problem and called it an answer. This question is still unanswered and if anyone knows how to clone the alpha maps, please let me know, thanks.

avatar image Eric5h5 · Nov 30, 2014 at 05:56 PM 0
Share

No, this is the answer. You apparently didn't understand it. You clone alpha maps by using GetAlphamaps and SetAlphamaps. There is no other way. If you've made your terrains unique then it works.

avatar image b1gry4n · Nov 30, 2014 at 06:06 PM 0
Share

Eric is correct, http://docs.unity3d.com/ScriptReference/TerrainData.GetAlphamaps.html

avatar image $$anonymous$$ · Nov 30, 2014 at 07:04 PM 0
Share

Eric, my terrains have the word (clone) after them in the hierarchy. Their colliders also have the word (clone) where "terraindata" is. And a setalphamap() on any one of the clones still changes them all. If my terrains are not "unique" then how do I make them more unique than this? Have you actually tested your code or are you just saying this? I kind of still don't think you are right but I'd be happy to be proven wrong.

avatar image Eric5h5 · Nov 30, 2014 at 07:34 PM 0
Share

Yes, it works fine; I've used it before and that's why I posted this answer. Just because the terrain object is a clone doesn't mean the terraindata it's using is a unique instance. Just like you can have many different objects using the same texture. If you use SetPixel on the texture, all the objects will change. If you don't want that, then you make unique textures. Same with terraindata.

Show more comments
avatar image
0

Answer by b1gry4n · Nov 30, 2014 at 05:31 PM

You need to apply a new terrain data to the terrain(s) you want unique. modifying terraindata directly without "cloning" will update all terrain using that terrain data.

 TerrainData newTerrainData = (TerrainData) Object.Instantiate(terData);

doing this in combination with erics answer will provide a solution

http://answers.unity3d.com/questions/211544/making-duplicate-terrain-unique.html

Comment
Add comment · Show 3 · 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 $$anonymous$$ · Nov 30, 2014 at 05:50 PM 0
Share

I appreciate your attempt to answer. However, I did clone the terraindata separately already. Alphamaps don't get cloned with the terraindata. Question still unanswered, anyone else know?

avatar image el_santo · Apr 22, 2015 at 02:31 PM 0
Share

@AaronBrownL$$anonymous$$? are you found solution? How are you clone?

avatar image el_santo · Apr 22, 2015 at 02:33 PM 0
Share

Now I see only one solution: create several TerrainData dublicates.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Update terrain alphamap at runtime makes my game crawling 3 Answers

Strange Error With AlphaMapHeight 0 Answers

Terrain edge fading into alpha mask 0 Answers

how does a splatmap alpha maps work (terrains) etc... 1 Answer

Instatiating an object. Altering that new object causes prefab to be altered. 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