JasonJ3d
Sept. 29, 2017 01:25:46
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
seelan
Sept. 29, 2017 09:45:00
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]
JasonJ3d
Sept. 29, 2017 13:17:56
Hi, thanks for the reply. Yes, I am using the vertex_fluid.shader and the color space is set to linear.
JasonJ3d
Oct. 2, 2017 23:39:11
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
mikelyndon-sesi
Oct. 3, 2017 05:14:03
Hi Jason. Can you upload the files for that example? And I can post a working file later today.
Mike
JasonJ3d
Oct. 4, 2017 00:18:53
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]
mikelyndon-sesi
Oct. 4, 2017 18:58:22
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
JasonJ3d
Oct. 6, 2017 18:46:20
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
mikelyndon-sesi
Oct. 9, 2017 10:56:28
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
JasonJ3d
Oct. 10, 2017 02:03:11
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
mikelyndon-sesi
Oct. 10, 2017 04:57:24
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
JasonJ3d
Oct. 10, 2017 22:46:54
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
mikelyndon-sesi
Oct. 11, 2017 09:14:27
Let's try that again. Serves me right for trying to make changes to an HDA while in an indie hip file.
JasonJ3d
Oct. 17, 2017 04:54:14
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
pupps09
July 11, 2018 01:50:31
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
mikelyndon-sesi
July 11, 2018 13:22:04
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
pupps09
July 12, 2018 00:58:54
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?
mikelyndon-sesi
July 12, 2018 18:39:19
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.
pupps09
July 13, 2018 02:28:39
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]
pupps09
July 17, 2018 03:50:30
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