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
0
Question by DeadKenny · Dec 23, 2014 at 04:10 PM · terrainmeshproceduralcullingterraintexture

Terrain detail meshes/trees via script?

How do I access the terrain detail section in the terrain data so I can paint it on the ground via script.

I have a script that procedurally generates the terrain by doing a few passes on perlin noise etc etc... and also adding textures, but have no idea how to do the same with terrain objects like trees and rocks in the same way it is painted manually.

I can instantiate them as game objects on the terrain randomly but that takes a lot of power and they don't have the nice culling stuff the terrain detail meshes do.

I'm sure this has been asked before, but I am having a tough time finding out how to do it.

Thanks.

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 Favor_89 · May 23, 2017 at 07:46 AM 0
Share

@Dead$$anonymous$$enny Could you please share your solution for this?

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by jeffreymarkbaldridge · Dec 23, 2014 at 05:12 PM

http://docs.unity3d.com/ScriptReference/TerrainData-treeInstances.html

I believe this is the array that holds the data for the different instances of the trees.

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 DeadKenny · Dec 23, 2014 at 05:34 PM 0
Share

Hmmm, not exactly what I am looking for but it helps somewhat. Thanks.

Wait does it get the trees placed on the terrain or added to the script?

If its the former then its exactly what I need. Busy looking now... I will accept answer if its true.

avatar image DeadKenny · Dec 23, 2014 at 07:41 PM 0
Share

Ok it isn't working as I intended. Too complicated, I'm going to try place them a different way.

avatar image jeffreymarkbaldridge · Dec 24, 2014 at 08:50 PM 0
Share

From my understanding of other features in Unity, this would provide a copy of the array of trees currently placed on the TerrainData you are calling this from. $$anonymous$$ost likely you would need to provide it an array with your generated trees to change it.

avatar image DeadKenny · Dec 26, 2014 at 06:08 PM 0
Share

I found another way. $$anonymous$$ade a separate script that instantiates trees/rocks into the scene with LOD and parents them.

avatar image
0

Answer by Favor_89 · May 23, 2017 at 08:46 AM

@DeadKenny Could you please share your solution for this?

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

28 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

Related Questions

How to generate a grid for procedurally generated platforms 1 Answer

Paint textures like on terrain but without terrain? 0 Answers

Strange shading on procedural mesh 0 Answers

How do I go about texturing a flat-shaded generated mesh? 1 Answer

Assigning Textures to Terrain at Runtime 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