VAT uv issue inside Unity
5249 12 1- seeplus
- Member
- 33 posts
- Joined: 11月 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
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 - 2021年8月25日 15:44:17
- MaiAo
- スタッフ
- 99 posts
- Joined: 2月 2021
- Offline
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
- Member
- 33 posts
- Joined: 11月 2019
- Offline
- MaiAo
- スタッフ
- 99 posts
- Joined: 2月 2021
- Offline
- MaiAo
- スタッフ
- 99 posts
- Joined: 2月 2021
- Offline
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 - 2021年8月27日 09:06:56
- seeplus
- Member
- 33 posts
- Joined: 11月 2019
- Offline
MaiAoseeplus
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.
thanksImage Not FoundImage 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
- スタッフ
- 99 posts
- Joined: 2月 2021
- Offline
seeplusMaiAoseeplus
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.
thanksImage Not FoundImage 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 - 2021年8月30日 10:44:32
- BagMan64
- Member
- 4 posts
- Joined: 9月 2017
- Offline
- MaiAo
- スタッフ
- 99 posts
- Joined: 2月 2021
- Offline
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
- Member
- 4 posts
- Joined: 9月 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]
Thanks
Your text to link here... [drive.google.com]
- MaiAo
- スタッフ
- 99 posts
- Joined: 2月 2021
- Offline
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
- Member
- 4 posts
- Joined: 9月 2017
- Offline
- MaiAo
- スタッフ
- 99 posts
- Joined: 2月 2021
- Offline
-
- Quick Links