Fluid vertex animation flickering

   8848   19   4
User Avatar
Member
29 posts
Joined: Aug. 2013
Offline
Hi, I followed the tutorials and webinar on bringing a fluid sim into Unity with vertex animation. Everything went smoothly, except the first few frames look great, but then the mesh starts flickering like in the attached images.

I checked the bbox min/max and the frame range and everything looks setup correctly.

Is there anything special on the fbx import in Unity that needs to be set? I have already turned off optimize mesh and import blendshapes. All compression is off on the textures as well as the filtering.

I also followed the cloth sim vertex animation tutorial and had no issues. Everything looks great which is why I think it may have something to do with the mesh import and it having varying poly counts per frame in the fluid example.

any thoughts?

thanks for your help,
Jason
Edited by JasonJ3d - Sept. 29, 2017 01:26:17

Attachments:
unityVTXfluid_01.jpg (32.8 KB)
unityVTXfluid_02.jpg (49.0 KB)

User Avatar
Member
571 posts
Joined: May 2017
Offline
Since its changing topology, make sure you're using the vertex_fluid.shader. Also make sure your color space is set to Linear.

According to your post, I believe you followed this tutorial, but just making sure: https://www.sidefx.com/tutorials/unity-shaders-for-vertex-animation-export-tools/ [www.sidefx.com]
User Avatar
Member
29 posts
Joined: Aug. 2013
Offline
Hi, thanks for the reply. Yes, I am using the vertex_fluid.shader and the color space is set to linear.
User Avatar
Member
29 posts
Joined: Aug. 2013
Offline
Looks like I am also getting the flickering with the vertex_sprite setup. Does anyone have an example of the vertex_fluid or vertex_sprite working in unity without flickering?

thanks,
Jason
User Avatar
Member
394 posts
Joined: May 2017
Offline
Hi Jason. Can you upload the files for that example? And I can post a working file later today.

Mike
User Avatar
Member
29 posts
Joined: Aug. 2013
Offline
Sure, here is a link to a zip containing the houdini files and the unity project. Thanks for looking.

https://www.dropbox.com/s/7forywe8lnosjry/Houdini_Unity_Vtx_Flicker.zip?dl=0 [www.dropbox.com]
User Avatar
Member
394 posts
Joined: May 2017
Offline
Hey Jason,

I just remembered that there's a unity example package as part of the GitHub download in the unity folder. Have you had a look at those yet?

Mike
User Avatar
Member
29 posts
Joined: Aug. 2013
Offline
Hey Mike,

Yeah, I did look at the package and those examples do work, but it seems that exporting with the latest tools doesn't, or at least I cannot seem to get it to work.

Have you had a chance to look at my files?

thanks,
Jason
User Avatar
Member
394 posts
Joined: May 2017
Offline
Hi Jason,

Your target polycount was too high. The mesh only has around 5000 points at each frame. By setting the target polycount to 10000 it's expecting at least 10000 points. If you drop that number down to something like 2000 it works as expected.

Mike
User Avatar
Member
29 posts
Joined: Aug. 2013
Offline
Great, that got it going for the fluid. I had a feeling it was something I was missing. Thank you! So, it seems that there is a polycount limit for bringing meshes into unity? If I raise the detail of the mesh so that the polycount and point count is over 10000, it still causes the same flickering. At least the 5000 count works for now.

Also, did you get a chance to check out the particle sprite in the file? I cannot seem to get that one to work either.

thanks,
Jason
User Avatar
Member
394 posts
Joined: May 2017
Offline
Hi Jason,

There were a couple of bugs in the export process. One was incorrectly setting the max no. of points and the other was incorrectly setting the resolution of the export texture. I've fixed both of them and submitted the changes to GitHub. Please download the latest development branch for the fixes.
https://github.com/sideeffects/GameDevelopmentToolset/tree/Development [github.com]

Sorry about that.

Mike
User Avatar
Member
29 posts
Joined: Aug. 2013
Offline
Hey Mike,

Thanks for updating that. Unfortunately, when I download it, the new ROP is empty. Looking into it further, it looks like the Contents.mime file is empty and 0 bytes. Maybe it didn't get posted correctly?

Thanks again,
-Jason
User Avatar
Member
394 posts
Joined: May 2017
Offline
Let's try that again. Serves me right for trying to make changes to an HDA while in an indie hip file.
User Avatar
Member
29 posts
Joined: Aug. 2013
Offline
Hi Mike,

Sorry, I've been out of town, just now got back to this. I downloaded the new update at github and the particle export now works really well. Thanks for fixing that up, really appreciate it.

-Jason
User Avatar
Member
13 posts
Joined: July 2014
Offline
Hi Mike,

I'm working in Houdini 16 (my company doesn't want to upgrade to 16.5) and I am getting the same flickering when exporting a flip sim as well. If I export a low poly sim, I can get decent results in Unity, but is there any work around with the Houdini 16 Game Dev Toolkit so I can get some higher resolution simulations to export?

I have Houdini 16.5 Apprentice, but with the resolution limits, I cannot export the textures out. I dug into the fluid COPNET and found that there is a Gamma node and Convert node attached for exporting to mobile(Unity). If you dont mind, can you give me any tips on what else I would need to change?

Thx in advance.

Naoki
User Avatar
Member
394 posts
Joined: May 2017
Offline
Hi Naoki,

Have you tried using the latest version of the Vertex Animation Texture tool for 16.5? I don't think there are any 16.5 specific nodes or features in that particular tool. You might just get some warnings.

Mike
User Avatar
Member
13 posts
Joined: July 2014
Offline
Hi Mike,

Thx for the quick reply. I tried using the latest version of the GameDev Toolset, but I still get the flickering triangles if my Target Poly count is too high. I lowered to 15000 and I get the mesh to preview in Unity, but the Global position is wrong as well as some pinching going on (refer to attached image). I'm thinking this has to do with the color conversion of the texture maybe? By the way, is the Target Poly count referring to the polygon count or the point count?

Attachments:
vat_error_01a.jpg (129.1 KB)

User Avatar
Member
394 posts
Joined: May 2017
Offline
It's possible that you're running into a precision issue. If the polycount is too high the second uv set may be packed too close together to get a proper texture read.
And the pinching looks like the texture is being imported in a normalised space. It's squashing everything into positive values. You probably want to double check your texture compression settings.
The target polycount is the number of polys, not the number of points.
User Avatar
Member
13 posts
Joined: July 2014
Offline
I checked my settings and everything looks like its in order.(see attached image)
I also exported out a low res sim and adjusted the Target Polycount accordingly, which resulted in the same pinching as before.

I then exported out the low res sim with the Game Dev Toolset for H16, which gave me decent results, shapewise, but I get that flickering still.

I've uploaded all related data to the link below. Would greatly appreciate it if you can check it out for me. No rush though.

https://www.dropbox.com/s/zpo716vnezytpcq/rnd_vat_test.zip?dl=0 [www.dropbox.com]

Attachments:
h16_unity_settings.jpg (165.6 KB)

User Avatar
Member
13 posts
Joined: July 2014
Offline
Hi Mike,

I think I got it to work. On the Houdini side, I rendered out the position and normal maps as .tga, instead of .exr.
Then, on the Unity side, in the texture import settings, I had to adjust the Max Size depending on the size of the rendered out maps.

I rendered out using Target Texture Size of 2048, which resulted in a 2048 x 2987 image. The default Max Size for a texture in Unity is 2048. Using the default settings, Unity relatively scaled the image down. In this case, 1404 x 2048. I changed the Max Size to 4096, which kept the original resolution and everything looks good.

Thx for all of your help.

Naoki
  • Quick Links