Search - User list
Full Version: VAT uv issue inside Unity
Root » Houdini for Realtime » VAT uv issue inside Unity
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
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

Could you send a file for us to debug? Thank you!
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.
MaiAo
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.
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



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.
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
MaiAo
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).
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
MaiAo
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.
BagMan64
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]
MaiAo
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:

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.
MaiAo
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:
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB