• 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 $$anonymous$$ · Jul 11, 2012 at 02:06 AM · terrainterraindataperlin

Absolute Position of Terrain Data

I've run into a block. My terrain generator runs much faster than most, but it isn't compatible with Unity's terrain, because w$$anonymous$$le my generator creates data positioned absolutely in 3D space, Unity's terrain objects can only handle values in an arbitrary space between zero and one. Here's what I mean...

The first layer of perlin noise, w$$anonymous$$ch I call "elevation" is the truly macro-scale octave. It has an amplitude of 2500 meters, 500 of w$$anonymous$$ch are below sea level (zero). Its wavelength is 10000 meters, to ensure it doesn't affect the overall map shape too much. Scaling these float values to fit in the space between 0.0f and 1.0f would lower precision too much.

Are there modifications I can make to the Terrain object, or is it possible to create a similar object, w$$anonymous$$ch will work with the Terrain Toolkit functions? (I'm okay with having to modify the Toolkit sources to connect with the new class)

I cannot change the generator because its effectiveness relies on generating absolute positions. If there's a way to translate the output to somet$$anonymous$$ng that will work with Unity's Terrain structures without sacrificing precision, please advise.

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
0
Best Answer

Answer by $$anonymous$$ · Jul 11, 2012 at 01:24 PM

I've tested it. Heightmap Resolution does not mean precision of data. It means the number of samples per row and column. T$$anonymous$$s, along with size determines how far apart samples are, and effectively how large the polygons of the terrain are. It's my impression that there is no way to improve precision, although I now know how to increase the height of the terrain object. Instead, since I will never have 2500 meters of elevation difference in the same terrain object, each piece of terrain generated by my generator I will put in a terrain object that is positioned and sized to contain all of the data in that square. The data will also have to be converted so that it will fit, but other than that, I see no drawbacks to t$$anonymous$$s method.

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 Owen-Reynolds · Jul 11, 2012 at 02:36 AM

The "Heightmap resolution" under the Terrain top-bar menu is the number of terrain positions. I've never gone t$$anonymous$$s $$anonymous$$gh, but you should be able to set it to, say, 65536 to store each height using 16-bits.

Sure, they'll still be 0-1(? didn't know that -- never looked at the raw data) but you can scale and lose less precision.

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 Owen-Reynolds · Jul 12, 2012 at 03:38 PM 0
Share

Oh, yes. Confirming my answer is completely wrong. HM-res is the number of sideways verts.

avatar image $$anonymous$$ · Jul 12, 2012 at 08:33 PM 0
Share

I didn't know it was wrong until after I confirmed your answer (that was when I went and tested it).

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Terrain.SetAlphamaps Question 1 Answer

TerrainData - Difference between alphamapResolution and alphamapWidth 0 Answers

Which function is used to paint terrains with the terrain engine? 0 Answers

I've written a script to create dynamic height maps. How do I use those height maps to generate dynamic procedural terrains? 1 Answer

Why is perlin noise generating flat terrain? 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