In unity, the edge of the height field tile has gap

   5504   5   0
User Avatar
Member
24 posts
Joined: 10月 2021
オフライン
I am trying to import the height field from Houdini to Unity, and since it is too big, I used the HeightField Tile Split node to split it into 4 pieces.
But when I import it into Unity, I find that there are gaps between each height field tile.

The HeightField Tile Split node parameter is the default.
If I change Voxel Padding, Tile Lower Overlap or Tile Upper Overlap, the terrain will be error.

I also tried Reconnect button in Unity Terrain component, but nothing happened either.

When I create a terrain in Unity, after clicking on Reconnect button and then using a brush to draw from the gap, the two pieces of terrain will be welded together. This operation does not work for terrain generated by Houdini.

How do I solve this problem?
Edited by misakacirno - 2023年1月4日 05:44:27
User Avatar
Member
24 posts
Joined: 10月 2021
オフライン
The process of trying
Create 2 terrain in Unity:


Draw some height:


Click the Reconnect (Note the edges of the flat terrain, where the normals seem to be modified):


The brush now can across 2 terrain:


Draw at the gap, the gap will be fill:


There is no gap even when you look at it in magnification:


Try same way at terrain from Houdini:
Edited by misakacirno - 2023年1月4日 06:18:56

Attachments:
1.png (1.3 MB)
2.png (871.6 KB)
3.png (961.8 KB)
4.png (792.5 KB)
5.png (1.3 MB)
6.png (301.8 KB)
7.png (590.3 KB)

User Avatar
Member
24 posts
Joined: 10月 2021
オフライン
It seems to me that a lot of people have the same problem:
https://www.sidefx.com/forum/topic/75955/ [www.sidefx.com]
https://www.sidefx.com/forum/topic/58330/ [www.sidefx.com]
Edited by misakacirno - 2023年1月5日 06:29:18
User Avatar
Member
24 posts
Joined: 10月 2021
オフライン
After some research, I think I know the problem.
In short, gaps occur because each height field has a different minimum and maximum value in the Y direction, which results in a difference in the mapping of terrain heights in Unity, resulting in gaps.

The way to solve this problem is to make sure that the minimum and maximum values for each terrain tile are the same.
I think this is a problem that should be solved in the plugin, adding the same mapping range to the tiles of the map to ensure that there are no gaps.
User Avatar
Member
1 posts
Joined: 10月 2019
オフライン
misakacirno
After some research, I think I know the problem.
In short, gaps occur because each height field has a different minimum and maximum value in the Y direction, which results in a difference in the mapping of terrain heights in Unity, resulting in gaps.

The way to solve this problem is to make sure that the minimum and maximum values for each terrain tile are the same.
I think this is a problem that should be solved in the plugin, adding the same mapping range to the tiles of the map to ensure that there are no gaps.

Hello, did you manage to do it ? because I have no clue how to set the same min/max value on each tile without altering the shape.
I would be happy to know your method
User Avatar
Member
24 posts
Joined: 10月 2021
オフライン
Diogene
misakacirno
After some research, I think I know the problem.
In short, gaps occur because each height field has a different minimum and maximum value in the Y direction, which results in a difference in the mapping of terrain heights in Unity, resulting in gaps.

The way to solve this problem is to make sure that the minimum and maximum values for each terrain tile are the same.
I think this is a problem that should be solved in the plugin, adding the same mapping range to the tiles of the map to ensure that there are no gaps.

Hello, did you manage to do it ? because I have no clue how to set the same min/max value on each tile without altering the shape.
I would be happy to know your method

Sorry — I haven’t logged into the forum in a long time, so I didn’t notice your message.

I did track down the issue, and I think it’s strongly related to the code in Assets\Plugins\HoudiniEngineUnity\Scripts\Utility\HEU_TerrainUtility.cs. However, I didn’t have time to actually implement a fix.

I can share the solution I suspect would work, but you’ll need to try it yourself to confirm:

Before using the HeightField Tile Split node, use VEX to store the HeightField’s global min and max values as Detail attributes.

Then, in C#, replace the code that reads the volume min/max values with code that reads those Detail attributes instead.

In theory, that should solve the problem. You can also find examples of how to read Detail attributes from C# in that same file.
  • Quick Links