Exporting a fish particle based sim

   2780   3   0
User Avatar
Member
104 posts
Joined: 11月 2007
Offline
Hi all,

I have a simple particle system with fish copied on which I'd like to get out into Unreal. I'm not really sure of the best way to this. I'm can't use Houdini Engine in this instance either.

I was think something similar to the way RBD sims are exported might work but I'm not really sure how to set things up for the RBD to FBX node?
User Avatar
Member
394 posts
Joined: 5月 2017
Offline
You could probably use the vertex animation texture export tools. Maybe a combination of the rbd for the centroids and the soft cloth for the deformation of the fish. Unless you want to drive the deformation of the fish through a simple sin shader.
Here's Luiz explaining the vertex animation texture tools - https://www.youtube.com/watch?v=U_-gGd6o70Y [www.youtube.com]

Mike
User Avatar
Member
104 posts
Joined: 11月 2007
Offline
Thanks Mike. That vertex animation workflow is very awesome. I got it working to a point. I use the RBD method and got 200 fish out and moving about as expected. Where I fell down is trying to combine the two methods. I couldn't see how I could “attach” a Softbody cache of a swimming fish to an RBD cache of the fish centroids.

Also I have a copy stamp which offsets the fish swimming motion and also changes the speed of the motion based on velocity so the fish swim harder when they are going fast. It would be really nice to get this over into Unreal too but I think that's probably asking too much of the vertex animation export. It might be possible in an unreal shader although I'm not sure how I would go about sampling the velocity? It would need the swimming cache and movement cache to be separate though so it would be good to solve that first if it's even possible.

I've attached a file in case that is useful.

Attachments:
clown_fish.bgeo.sc (55.2 KB)
fish_swarm_v001.hip (1.8 MB)

User Avatar
Member
394 posts
Joined: 5月 2017
Offline
To combine the soft body and rbd cache I would write out the fish animation with the fish at the origin. Then in the unreal shader you would need to combine the texture values from the rbd and soft body cache. It's all about figuring out how to use world position offset to control the overall position of each fish as well as the deformation.

Instead of sampling the velocity you could write the speed out as a float value to the texture. Maybe use the alpha channel in the position texture since that isn't being used. Then you can use that as a multiplier of the time value controlling the animation of the fish.

Mike
  • Quick Links