Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
2
Question by UKCEH · Jul 10, 2020 at 02:55 PM · terrainheightmapterraindataterrain generationheightmaps

Change Terrain Heightmap Resolution without Resizing Terrain

Inspector Behaviour (Desired Effect)

When I change my terrain's heightmap resolution through the inspector via:

Terrain -> Terrain Settings -> Texture Resolutions (On Terrain Data) -> Heightmap Resolution,

the resolution of my heightmap is increased without the terrain visibly changing.


Script Behaviour (Unexpected Effect)

However, when I try to recreate this behaviour via script like so: Terrain.activeTerrain.terrainData.heightmapResolution = 1025;

The terrain not only changes heightmap resolution but also size, with very strange effects like repeating textures etc.


How can I resize the heightmap via script WITHOUT any visible changes to the terrain, exactly as done via the inspector?


Essentially, I want to produce the exact same change produced by selecting the following, but via a script:

alt text

screenshot.png (37.7 kB)
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 TurboHermit · Aug 06, 2020 at 06:11 PM 0
Share

Lookin' for the same thing. Found a solution for this yet?

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by subliminal_1 · Dec 30, 2020 at 02:07 AM

I'm having the same problem. I can generate a scripted terrain at a heightmapScale of (1, 200, 1), but with terrain at size 4096 the heightmapResolution must be 4097. Then I can manually lower the heightmapResolution in the editor to say, 257 which then works fine after applying the "resizing" button in the Unity Terrain editor. Then I see (via script) that the heightmapScale has been reset by the editor's resizing to the value (16, 200, 16). This all makes sense since 16*256 + 1 = 4096 + 1.

However, my problem is that I have to do this manually for all of my terrain tiles. Why can't Unity support the editor's resizing button with a scripting function? Or simply provide a scripting function to map lower resolution heightmaps onto terrains? Is some way to do this?

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 kenncann · Mar 29, 2021 at 02:16 AM 0
Share

Did you ever find a solution for this? I'm having the exact same problem

avatar image kenncann kenncann · Mar 30, 2021 at 06:58 AM 0
Share

Someone knew how it was implemented, see this thread here

https://forum.unity.com/threads/looking-for-advice-to-programmitcally-increase-heightmap-resolution.1083785/#post-6985445

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

232 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 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 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

Terrain get sample height gives slightly wrong results,Terrain sampleheight gives SLIGHTLY wrong answer 1 Answer

How do I set a Render Texture as the HeightMap for a Terrain? 0 Answers

How does one convert a System.Drawing type Bitmap into a compatable terrain heightmap for unity 0 Answers

How to increase the performance of terrain generation? Unity 2017.2.0f3 0 Answers

How to export Heightmap(Terrain) Raw.(Script) 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