Slower sim performance due animated values. (Suction Force : Outside Distance)

   1811   4   1
User Avatar
Member
15 posts
Joined: Jan. 2017
Offline
I am new to houdini and yesterday I followed the tutorial for the new suction force. What I noticed was when I was using a higher volume resolution (inside the suctiontarget) for the target geometry and animate the outside distance value like in the video. I get a much slower simulation performance even when the value isn't moving.

Example:
The outside distance value is 1 for the whole duration of the simulation and it'll take around 1 min to go through 120 frames.
Now I just put some keyframe on the outside distance value.
Value is @ 1 for the first 40 frames and than goes from 1 to 0.5 during frame 41-60. The sim will take around 2 minutes now. This happens with OpenCl and without.

Even after the sim with when the sim files are still in memory (blue timeline) scrubbing through the first 60 frames is slow.

Anybody know what could be the cause of this?

Kind regards,
Ralph
User Avatar
Staff
6189 posts
Joined: July 2005
Offline
This sounds like a VEX-based DOP node is becoming animated and being rebuilt every frame. This causes it to lose binding information and pay a high overhead cost per cook. The good news is that if this is the case, the slow down will not scale with your sim. If you make your sim a 1 hour sim rather than 1 min sim, you may still only have the 1 min of overhead.

However, it would be good to find out what is going on, so if you have can provide a .hip file that demonstrates it, I would appreciate it.
User Avatar
Member
15 posts
Joined: Jan. 2017
Offline
Thanks for the response jlait. What I noticed after rebuilding the scene is that it is the suctiontarget(collision source) node that is responsible for the slow down. It is cooking every frame even when no value change is occurring during the animation (e.g value of 1 during the first 40). The lower the voxel size the larger the slow down.

I attached two files. 1 with animated values and one without. Hopefully that helps.

Attachments:
suction_not_animated.hipnc (1.7 MB)
suction_animated.hipnc (1.7 MB)

User Avatar
Staff
6189 posts
Joined: July 2005
Offline
Your diagnosis is correct!

Turning on the performance monitor here will make the collision source show up bright red, revealing it as the time waster.

The decision to recook geometry is based on time-dependence, not on parameter values. So even though the collision source has the same parameter value every frame, since the outside diameter is marked as time dependent, the collision source will be recooked every frame.

If your collisions source is truly animated (ie, it is deforming geometry) you are going have to rebuild the SDF regardless. In this case you may want to look at increasing the voxel size. For a sphere like this, a voxel size of 0.1 would actually suffice and give you way faster performance.

If you have animated collisions and wish to run many sims you can use a File Cache node to cache out the suction_target. This way you only have to pay for file reads each frame as you dial in your simulation.

If your collision source isn't animated, you can easily remove the dependency by removing the channel reference for Exterior Band. The Exterior Band has to be bigger than the maximum value your suction force outside distance has. So if it has a value of 2 going to 0.5, you can change the suction_target to have a constant “2” for its Exterior Band. Because it isn't animated anymore, you won't get recooks each frame.
User Avatar
Member
15 posts
Joined: Jan. 2017
Offline
Thanks for the explanation. I know the voxel size was overkill for a sphere I just cranked it up that high to really show the issue I was having. But taking out the dependency is a good advice. Thanks a lot for that.
  • Quick Links