Terrain resolution: Is this a doc mistake or am i misunderstanding something

   2193   2   2
User Avatar
Member
52 posts
Joined: Nov. 2016
Offline
Hey there.

https://www.sidefx.com/docs/unity/_terrain.html#Terrain_Size [www.sidefx.com]

I had a look at these terrain tile sizes and got a bit confused.
I assume it is resolution that is meant.
In Unity you are not locked to power of 2 + 2, but apparantly, power of 2 + 1..
Is this what is meant? Or am I missing something?

I am trying to set up a render pipeline and figure out how to go about setting up multiple tiles next to each other but store them all in one big texture, so need to figure out exactly how big a heightmap should be..
Edited by MartinBaadsgaard - July 12, 2018 09:23:21

Attachments:
2018-07-12 14_21_15-Clipboard.png (6.4 KB)

User Avatar
Member
571 posts
Joined: May 2017
Offline
By size, it means Houdini's heightfield's Size (see attachment). By using a value for heightfield size that is a power of 2 + 2, you will get the best fit when we convert into Unity's terrain which requires a heightmap resolution that requires power of 2 + 1 size. The power of 2 + 2 requirement is due to how volume data comes from Houdini, then needing to convert to satisfy Unity's requirement (odd number sizes don't work well due to some divisions by 2 when converting to Unity).

The power of 2 + 2 works well when using 1 tile.

If you're using multiple tiles, I'd recommend trying out various heightfield size value and tile split combinations that give you the correct size for all tiles without padding or any overlap. I found that sticking with power of 2 or near power of 2 + some multiple of 2 work best.
E.g. With a 512x512 terrain size, I can split into 4 tiles (2x2) and get all 4 tiles aligned perfectly.

Admittedly there is a bit of trial and error here to get the size and tile count working well. This is largely due to how either application handles heightfield and terrain data. Please let me know if you find any issues, or suggestions to improve it.

Attachments:
hf_size.png (11.5 KB)

User Avatar
Member
52 posts
Joined: Nov. 2016
Offline
Oh alright, well I would much rather have power-of-two since I am making my own terrain rendering for tiles at a distance.

I'll let you know if there are any oddities, but that might be some time next year

Cheers!
  • Quick Links