Splitting vertices inside Unity

   3189   14   2
User Avatar
Member
13 posts
Joined: Aug. 2019
Offline
Hi everyone!
I'am a newbie in Houdini and a i have big problem with my hda inside Unity.
So my question is how to avoid split verteces and keep my uv's in the right place?

For example i proceduraly generated a trunk model that has some kind of lengh and division count in widgh and i can tweak it inside unity. I make uv for the tiling texture (vertex attributes), uv in second channel for the lightmap bake which carefull packed into one udim (also vertex attr) also i have a vertex color gradient for animate by shaders and so on. Upd store all data in points.

If i export that hda as fbx from houdini and open in 3ds max for example i'll see a good geo and perfect uv's with curent seams, but if i drop it to the unity it'll brake all vertices and my split count grow up… 70 verex VS 324 for example for the trunk with 6 by 10 divisions… it's realy a huge problem for mobile games and i need the solution to avoid splitting.

Dive into Houdini Engine for Unity documentation i can find this “Note that, by default, meshes will be generated using split vertices (i.e. each triangle will have unique vertices). This can be changed to using Points (shared vertices) by enabling Generate Mesh Using Points checkbox in the ASSET OPTIONS section.” - so i try… but in this case it's realy weld vertices but loose all uv's.

I can't find any tutorials or any documentations or topics about that issue.
Can anyone answer how its works?
Edited by cgrum - Sept. 9, 2019 09:10:52
User Avatar
Member
13 posts
Joined: Aug. 2019
Offline
The problem is in the houdini version 17.5.327.
My colegue test this issue in 17.5.173 and it works fine by checking th Generate Mesh Using Points.

So it's looks like a bug in version.
User Avatar
Member
571 posts
Joined: May 2017
Offline
Please submit a bug report with an HDA example.
User Avatar
Member
12 posts
Joined: Aug. 2017
Offline
So after some tests I can say that in Houdini 17.5.173 everything works just fine. It is really bug in later versions. The bug was submitted by me too.
User Avatar
Member
571 posts
Joined: May 2017
Offline
The Generate Mesh Using Points requires attributes to be point-owned, and will ignore vertex-owned attributes. Are you seeing point-owned UVs being ignored? If someone can attach an HDA I can test it out.
User Avatar
Member
13 posts
Joined: Aug. 2019
Offline
seelan
The Generate Mesh Using Points requires attributes to be point-owned, and will ignore vertex-owned attributes. Are you seeing point-owned UVs being ignored? If someone can attach an HDA I can test it out.
I have no data in vertex. All data stored in points.
Edited by cgrum - Sept. 9, 2019 15:35:55
User Avatar
Member
571 posts
Joined: May 2017
Offline
Could you post a screenshot of your attributes in Houdini (geometry spreadsheet or Node Info)?
User Avatar
Member
13 posts
Joined: Aug. 2019
Offline
seelan
Could you post a screenshot of your attributes in Houdini (geometry spreadsheet or Node Info)?
It's work for 17.5.173 but wont work for 17.5.327
Edited by cgrum - Sept. 9, 2019 15:49:27

Attachments:
2019-09-09_22-47-00.jpg (112.3 KB)
2019-09-09_22-47-11.jpg (45.6 KB)

User Avatar
Member
12 posts
Joined: Aug. 2017
Offline
Here is screenshot from unity. I am so sure that my attributes only on points. I spent all day checking different variations trying to solve this issue. And sure enough it is a bug in recent versions. Once again in 17.5.173 everything works just fine

Attachments:
Screenshot_14.png (309.3 KB)

User Avatar
Member
12 posts
Joined: Aug. 2017
Offline
Support ask me if I can test the latest build. And I find same bug in most recent version too.
User Avatar
Member
571 posts
Joined: May 2017
Offline
Thank you. I am looking into this.
User Avatar
Member
571 posts
Joined: May 2017
Offline
I committed a fix which will be available in tomorrow's 17.5 daily build.

If you want to give it a try today, you can change the following line 1853 in HEU_GenerateGeoCache.cs from:

if (geoCache._uvsAttrInfo[u].exists && geoCache._uvsAttrInfo[u].owner == HAPI_AttributeOwner.HAPI_ATTROWNER_POINT && positionIndex < geoCache._uvsAttr.Length)

to:

if (geoCache._uvsAttrInfo[u].exists && geoCache._uvsAttrInfo[u].owner == HAPI_AttributeOwner.HAPI_ATTROWNER_POINT)

Let me know if you tried it and it fixed the issued.
User Avatar
Member
12 posts
Joined: Aug. 2017
Offline
seelan
I committed a fix which will be available in tomorrow's 17.5 daily build.

If you want to give it a try today, you can change the following line 1853 in HEU_GenerateGeoCache.cs from:

if (geoCache._uvsAttrInfo[u].exists && geoCache._uvsAttrInfo[u].owner == HAPI_AttributeOwner.HAPI_ATTROWNER_POINT && positionIndex < geoCache._uvsAttr.Length)

to:

if (geoCache._uvsAttrInfo[u].exists && geoCache._uvsAttrInfo[u].owner == HAPI_AttributeOwner.HAPI_ATTROWNER_POINT)

Let me know if you tried it and it fixed the issued.

Thank you! I have replaced the code and it works. For now I tested it with only uv on points but it works as expected. If something will go wrong with other attributes I'll let you now. Thank you for your fast responses and for fixing the issue. Cheers!
User Avatar
Member
12 posts
Joined: Aug. 2017
Offline
Tested with uv, uv2, and Cd attribute on points. Everything works correctly. Thank you once again)
User Avatar
Member
571 posts
Joined: May 2017
Offline
Thank you for the update.
  • Quick Links