YOUR ACCOUNT

Login or Register to post new topics or replies
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
If I have the loop set up with 1000 iterations, but the result may already be available after 2 iterations - how do I get out?

I may fail to see the obvious solution - but it seems we need a way to "get out" of the loop before it reaches the maximum number of iterations.

I propose a special input called "Bailout" that if non zero will stop at the current iteration.

(btw. the need for that functionality was mentioned during the V4 beta rounds)
  Details E-Mail
xirja
Idididoll Forcabbage

Posts: 1698
Filters: 8
smile:fairy: oh no, please, not that thread.
_____________________________________________________

http://web.archive.org/web/2021062908...rjadesign/
_____________________________________________________
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
  Details E-Mail
Kraellin
Kraellin

Posts: 12749
Filters: 99
yeah, a 'cancel' switch makes a lot of sense here.
If wishes were horses... there'd be a whole lot of horse crap to clean up!

Craig
  Details E-Mail
ThreeDee
Lost in Space

Posts: 1672
Filters: 112
Not exactly the same thing, for it still would run through all the loops, but using the OR component to produce a different input (fully transparent, for instance) for the loop instead of the complex (whatever you are building) once a certain condition has been met might help in speeding up rendering...? Just a theory.

An exit option would obviously be better.
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
Yeah, thats how I do it now, with a treshold (the If component seem to draw samples from all inputs regardless of the "case"). But even that approach is quite slow and inoptimal :-/
  Details E-Mail
ThreeDee
Lost in Space

Posts: 1672
Filters: 112
Ok, how about another inefficient idea then: A Script component that either passes the source image through or, after a condition has been met, outputs a transparent black for every pixel regardless of source input?
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
That is even more expensive than the threshold trick. About 18 times slower (entering a scripting context is itself quite slow, which is why you should avoid too many different script components in a filter).
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
Perhaps this could be made as a slave "Stop Condition" node that works somewhat like the If components (but with grayscale map inputs instead).

The "Stop Condition" slave node would have two inputs, A and B and an operator selector like the If.

You can then force the iteration to stop before it reaches the maximum iterations e.g. when A == B
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
Bump!

Example:
I have set the loop up for 100 iterations. In most cases (samples) I know I can exit after 10 iterations, but there is no way to escape the loop for those samples.

I suggest that the main loop component gets a mapped Boolean input called "Stop" / "Exit" / "Bailout" etc. This input is evaluated per iteration and when a positive exit condition is received, the loop simply stops at the given iteration and use the result at this point for that given output sample.
  Details E-Mail
emme
Posts: 718
Filters: 8
Bump, mappable loop iteration count / break would be great!
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
  Details E-Mail
Beat
Beat
Posts: 165
It definitely would be nice to escape a loop at a user determinable point. Seems basic.

I would even ask for more : a way to stop the rendering process, by a keyboard shortcut or maybe a component, that you can include into your filter.
I often see results on my screen while still rendering, that look far better than the final result. I do not know if the screen build up kind of parallels the actual rendering in memory, but if that is the case, I'd like to stop the rendering as soon as I like the result I see on the screen. I have the same experience in Topaz Simplify, where the 'crude' result on my screen often looks far more interesting, than the final, precisely rendered result.

Beat
The Stone Age did not end because they ran out of stones. Niels Bohr
  Details E-Mail
Skybase
2D/3D Generalist

Posts: 4025
Filters: 76
Beat, you're off topic.

Or should I say... off beat.
  Details E-Mail
Beat
Beat
Posts: 165
Nice pun smile:-)

Sorry, I felt it touched upon the subject, stopping a process. But no problem if you think it's too general or too far removed from the topic. I will post it in a separate thread.
The Stone Age did not end because they ran out of stones. Niels Bohr
  Details E-Mail

Join Our Community!

Filter Forge has a thriving, vibrant, knowledgeable user community. Feel free to join us and have fun!

33,711 Registered Users
+18 new in 30 days!

153,531 Posts
+39 new in 30 days!

15,347 Topics
+72 new in year!

Create an Account

Online Users Last minute:

16 unregistered users.