Jump to content

Can loops be frame-dependent?


Recommended Posts

Yes, just animating the number of iterations it will do.

You can just use $F in iterationson the block end if you are working on SOP and it will do the trick or just key frame it. Basically the same thing if you are doing it in vex.

Frame 1 = 1 iteration..... frame 10 = 10 iterations.

Link to comment
Share on other sites

use Solver SOP for such cases

otherwise, doing it by animating iteration count, you will be paying the cost of computing all iterations every frame up until the current iteration count (so frame 100 wil compute full 100 iterations from scratch instead of one from 99 to 100 as Solver SOP would)

Link to comment
Share on other sites

2 hours ago, anim said:

use Solver SOP for such cases

otherwise, doing it by animating iteration count, you will be paying the cost of computing all iterations every frame up until the current iteration count (so frame 100 wil compute full 100 iterations from scratch instead of one from 99 to 100 as Solver SOP would)

Yep to this. I was going to mention it, but I didn't want to overcomplicate the answer. But yes solver sop is the way to go for things like this.

Link to comment
Share on other sites

15 hours ago, Daniel_Daniel said:

solver wouldn't work for me, because you can't put it in compile blocks. I am looping through two opencl nodes, which for loop nodes can handle efficiently, because they are compilable

you can compile the inside of the Solver SOP, and even do subsequent iterations within Solver SOP using internal For Loop to do subframe steps this way if you want to

however to carry over the results from of previous frame you'd want to use DOPs, so Solver SOP is the most straightforward way, if you want to get more optimized version use SOP Solver DOP and invoke compiled block directly, which saves you some geometry copying between SOPs and DOPs

also if your nodes are openCL you can directly use OpenCL DOP 

have a look at Vellum Solver DOP and see how various OpenCL and compiled SOP Solver DOPs are used

 

  • Like 1
Link to comment
Share on other sites

12 hours ago, anim said:

you can compile the inside of the Solver SOP, and even do subsequent iterations within Solver SOP using internal For Loop to do subframe steps this way if you want to

however to carry over the results from of previous frame you'd want to use DOPs, so Solver SOP is the most straightforward way, if you want to get more optimized version use SOP Solver DOP and invoke compiled block directly, which saves you some geometry copying between SOPs and DOPs

also if your nodes are openCL you can directly use OpenCL DOP 

have a look at Vellum Solver DOP and see how various OpenCL and compiled SOP Solver DOPs are used

 

Thanks a lot for those suggestions, that sounds very promising - I will do a test for Solver DOP then and see if I'll manage to get OpenCL code to work there.

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...