VAT uv issue inside Unity

   5256   12   1
User Avatar
Member
33 posts
Joined: Nov. 2019
Offline
Hi all,

I'm have been struggling with is issue for days and can't figure it out.

The uvs inside Houdini are perfect during all frames and in Unity they are neat just for the first frame but when I move to the next frame, the uvs/texture are missed up.

I’ve exported the mesh as Fluid to Unity.

thanks
Edited by seeplus - Aug. 25, 2021 15:44:17

Attachments:
uv issue.jpg (106.6 KB)
TestVat.rar (12.0 MB)

User Avatar
Staff
99 posts
Joined: Feb. 2021
Online
seeplus
Hi all,

I'm have been struggling with is issue for days and can't figure it out.

The uvs inside Houdini are perfect during all frames and in Unity they are neat just for the first frame but when I move to the next frame, the uvs/texture are missed up.

I’ve exported the mesh as Fluid to Unity.

thanks

Could you send a file for us to debug? Thank you!
Mai Ao
Senior Technical Lead of SideFX Labs
youtube.com/@notverydarkmagic
User Avatar
Member
33 posts
Joined: Nov. 2019
Offline
MaiAo
Could you send a file for us to debug? Thank you!
Thanks for coming across my issue. I have attached the hip file at the head post.
Edited by seeplus - Aug. 25, 2021 15:46:43
User Avatar
Staff
99 posts
Joined: Feb. 2021
Online
seeplus
MaiAo
Could you send a file for us to debug? Thank you!
Thanks for coming across my issue. I have attached the hip file at the head post.
LOL I missed it, haha. My bad.
Mai Ao
Senior Technical Lead of SideFX Labs
youtube.com/@notverydarkmagic
User Avatar
Staff
99 posts
Joined: Feb. 2021
Online
seeplus
Hi all,

I'm have been struggling with is issue for days and can't figure it out.

The uvs inside Houdini are perfect during all frames and in Unity they are neat just for the first frame but when I move to the next frame, the uvs/texture are missed up.

I’ve exported the mesh as Fluid to Unity.

thanks
Image Not Found



Hi,

I've tested your file. Nothing seems off. I wonder if you were using mesh UV as UVs? If so please note that Dynamic Remeshing mode's UVs come from textures, not the geometry.

In Unity, please make sure you duplicate the VAT shader in the package and move the duplicated version into your own directory so you can modify it. Re-parent your material to your duplicated version. Then follow the setup of the shader to see where the UVs are coming from. Also, VAT3 only works properly for Unity 2021.2.0b3+ as explained in the installation guide text file.

In Houdini, you have the option to export UVs through Color Red and Green or Position Alpha and Color Alpha. If you go with Color RG, please turn on the corresponding checkbox in the material to tell the shader where to look for the UVs. If you go with Pos/Col Alpha, turn off that checkbox.
Edited by MaiAo - Aug. 27, 2021 09:06:56

Attachments:
test_vat [Verified].hip (4.9 MB)
Unity_CKFCPScZqI.png (866.6 KB)

Mai Ao
Senior Technical Lead of SideFX Labs
youtube.com/@notverydarkmagic
User Avatar
Member
33 posts
Joined: Nov. 2019
Offline
MaiAo
seeplus
Hi all,

I'm have been struggling with is issue for days and can't figure it out.

The uvs inside Houdini are perfect during all frames and in Unity they are neat just for the first frame but when I move to the next frame, the uvs/texture are missed up.

I’ve exported the mesh as Fluid to Unity.

thanks
Image Not Found

Image Not Found


Hi,

I've tested your file. Nothing seems off. I wonder if you were using mesh UV as UVs? If so please note that Dynamic Remeshing mode's UVs come from textures, not the geometry.

In Unity, please make sure you duplicate the VAT shader in the package and move the duplicated version into your own directory so you can modify it. Re-parent your material to your duplicated version. Then follow the setup of the shader to see where the UVs are coming from. Also, VAT3 only works properly for Unity 2021.2.0b3+ as explained in the installation guide text file.

In Houdini, you have the option to export UVs through Color Red and Green or Position Alpha and Color Alpha. If you go with Color RG, please turn on the corresponding checkbox in the material to tell the shader where to look for the UVs. If you go with Pos/Col Alpha, turn off that checkbox.

Hey MaiAo,

This was really helpful and I'm happy we have you among Houdini Staff. I will work per your guidance but currently our game is under Unity 2020 and I'm using VAT 2.1. So, can I implement the above workflow for UVs with 2.1?


Regards
User Avatar
Staff
99 posts
Joined: Feb. 2021
Online
seeplus
MaiAo
seeplus
Hi all,

I'm have been struggling with is issue for days and can't figure it out.

The uvs inside Houdini are perfect during all frames and in Unity they are neat just for the first frame but when I move to the next frame, the uvs/texture are missed up.

I’ve exported the mesh as Fluid to Unity.

thanks
Image Not Found

Image Not Found


Hi,

I've tested your file. Nothing seems off. I wonder if you were using mesh UV as UVs? If so please note that Dynamic Remeshing mode's UVs come from textures, not the geometry.

In Unity, please make sure you duplicate the VAT shader in the package and move the duplicated version into your own directory so you can modify it. Re-parent your material to your duplicated version. Then follow the setup of the shader to see where the UVs are coming from. Also, VAT3 only works properly for Unity 2021.2.0b3+ as explained in the installation guide text file.

In Houdini, you have the option to export UVs through Color Red and Green or Position Alpha and Color Alpha. If you go with Color RG, please turn on the corresponding checkbox in the material to tell the shader where to look for the UVs. If you go with Pos/Col Alpha, turn off that checkbox.

Hey MaiAo,

This was really helpful and I'm happy we have you among Houdini Staff. I will work per your guidance but currently our game is under Unity 2020 and I'm using VAT 2.1. So, can I implement the above workflow for UVs with 2.1?


Regards

Thank you for the kind words! And unfortunately, fluid UVs will not work with 2.1 in Unity. Precisely speaking, it is not that 2.1 can't support it, but that Unity can only support a feature called Custom Interpolator after version 2021.2+, and we absolutely need this feature otherwise fluid UVs won't work.

For more information: Custom Interpolator interpolates data on the vertex shader (which process the changing UVs exported through textures on a per vertex basis) to the correctly interpolated values for the fragment shader (which use the interpolated UVs to sample surface textures per fragment).
Edited by MaiAo - Aug. 30, 2021 10:44:32
Mai Ao
Senior Technical Lead of SideFX Labs
youtube.com/@notverydarkmagic
User Avatar
Member
4 posts
Joined: Sept. 2017
Offline
Hey Mai I'm having issues getting uvs to work properly in Unreal. Im using 4.26 and latest VAT3.0 updates. Here's a gif with and without uvs from houdini in unreal.

Thanks, Liam

Attachments:
withuvs.gif (10.9 MB)
withoutuvs.gif (9.8 MB)

User Avatar
Staff
99 posts
Joined: Feb. 2021
Online
BagMan64
Hey Mai I'm having issues getting uvs to work properly in Unreal. Im using 4.26 and latest VAT3.0 updates. Here's a gif with and without uvs from houdini in unreal.

Thanks, Liam

Hey Liam,

I suspect UV is not the culprit here. The first one looks correct except there are some glitches which typically get removed after you restart the engine after the initial import.
Mai Ao
Senior Technical Lead of SideFX Labs
youtube.com/@notverydarkmagic
User Avatar
Member
4 posts
Joined: Sept. 2017
Offline
Hey I've tried restarting UE, but Im getting the same results. Here is a google drive link to my UE and hip file. Im using houdini 18.5.532 and UE 4.26.

Thanks


Your text to link here... [drive.google.com]
User Avatar
Staff
99 posts
Joined: Feb. 2021
Online
BagMan64
to

Hey, I got it to work. Thanks for bringing this to our attention. It was a very sneaky problem.

What happened was that Unreal optimized your mesh. In that process, it fused together some vertices along the fracture seams. Unreal would fuse vertices together if all their vertex attributes are identical in value, i.e. if they have the same position, UVs, colors, normals, tangents... This is typically not a problem, but it became a problem when vertices along your seams happen to have all same attribute values for every attribute.

Because your mesh was perfectly flat, so all the vertices will get the same normal. The UVs you provided had the same values for vertices on either side of the seams. Because the tangents are computed from normals and UVs, they also ended up being the same. So Unreal optimized/fused them. You will noticed the broken version had a fewer vertices in Unreal.

The reason it worked when you did not provide UVs was VAT ROP auto computes UVs for you when they are missing, and the auto-computed UVs moved vertices on either side of the seams into their own separate UV islands. So in Unreal, those seam vertices are not identical in every attribute.

My fix was adding a small 0~0.0001 range random UV offset to the vertices along your seams. You won't notice that small of a UV discrepancy, and it side steps the problem. The result:

Attachments:
vellum_UE_testcloth [Fixed].hip (2.6 MB)
UE4Editor_kXf4gjl1ET.png (947.1 KB)

Mai Ao
Senior Technical Lead of SideFX Labs
youtube.com/@notverydarkmagic
User Avatar
Member
4 posts
Joined: Sept. 2017
Offline
Ok thanks for your help. Here's an update on the cloth comparing VAT to Alembic, but I noticed that the reverse side is black/darker for VAT.
Edited by BagMan64 - Sept. 22, 2021 11:28:14

Attachments:
test_vellum.gif (4.3 MB)
VAT.JPG (78.9 KB)

User Avatar
Staff
99 posts
Joined: Feb. 2021
Online
BagMan64
Ok thanks for your help. Here's an update on the cloth comparing VAT to Alembic, but I noticed that the reverse side is black/darker for VAT.

If you have turned Two Sided in the Material, please double check you have turned Two Sided Normals in the VAT Material Instance.

Off:



On:

Attachments:
UE4Editor_HIT8YKlmJ8.png (879.4 KB)
U4F58LK2iW.png (864.4 KB)

Mai Ao
Senior Technical Lead of SideFX Labs
youtube.com/@notverydarkmagic
  • Quick Links