Jump to content

Alternative to for each loops


Pancho

Recommended Posts

Not that I've found one, but is there one?

My point, coming from SI, loops are a no go area since they tend to be veeeerrrry slowly. For Houdini so far I have the same feeling.

I use a Voronoi node to break up something. Afterwards each shard gets fractured again in a Voronoi node inside a for each loop (first I used connectivity to assign a group name for each shard).

While the initial voronoi fracturing is ultra fast, the additional fracturing in the for each loop takes forever (o.k., 15min compared to 1s).

In ICE one would usually try to use arrays to avoid a loop. SI would get "forced" to do the calculation over and over again till each entry in the array would have been taken care of. Well, I topology was/is pretty much unusable compared to Houdini, but that's something else ...

So, are there possibilities to speed this stuff up? Especially with a third fracturing round one starts to feel depressed. What's the philosophy in Houdini to make this the right way?

Cheers

Tom

Edited by Pancho
Link to comment
Share on other sites

Hey Tom,

 

I'd like to mention cheating. If I were tasked with recursive fractures for a shot, I would want to know if all of it can be seen, or only some of it has to fracture 3 times. Is the camera far away? Can I just use instanced geometry on points for the 3rd breakup? This creates a lot of room for skirting around the issue.

 

If you cannot skirt around the issue and you need to do three recursions of fracture, then writing to disk is your friend.

 

Whenever your node chain becomes a little long, a little less responsive in the viewport, always throw down a cache, or write/read some part of the chain to disk. Eventually things will still slow down. Then use blast sop, delete sop, etc and view smaller and smaller regions of your effect. You can even do the smaller region method without writing to disk. You are fracturing a pillar 4 levels deep. Just do the very top of it. If that looks good and you need to see the whole thing, do the whole thing 2 levels. If that looks good, turn everything on overnight and see what you get in the morning.

Link to comment
Share on other sites

Well, nice tips. Reminds me of the Golden Gate Bridge way back then. To save memory they just modeled the part which would face the camera.

IWith my question I did have a more general way of working in mind, like is there a way to avoid the For Each loop, but have the same functionality. In SI loops were single threaded (as far as I can tell). Probably it's the same in Houdini. Just want to find ways to work efficiently.

Link to comment
Share on other sites

Are you doing these as pre-fracturing for a dynamics effect? You might try implementing the recursive fracturing in a SOP solver within the DOP net. That way you can decide where and when secondary fracturing should occur according to your simulation rules. You can find a few threads around here about that kind of thing.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...