YOUR ACCOUNT

Login or Register to post new topics or replies
CorvusCroax
CorvusCroax

Posts: 1227
Filters: 18
So, working on a filter last week, I found myself wondering what 'direction' FF operations happen in, and how it impacts speed. Does it work moving toward the result component, or does it work backwards from the result component?

Question 1:
Suppose you have a big complicated branch of noises and refractions and offsets. It's slow. You want to put an on/off switch on it. You do this with a blend and an checkbox control. Is it better to do this NEAR the result component, or AWAY from the result component. (I'd assume that you want it away, but I'm not actually sure.)

Question 2:
If you have unused noise components which are unused, say, by being the alternates on a switch node - are those noise components still calculated and 'weighing down' your filter?

Any clarity much appreciated!
  Details E-Mail
KGtheway2B
KGtheway2B

Posts: 660
Filters: 34
You'd want to put any off/on switches near the result component. If you turn "off" the slow parts of the filter, the program will skip over them entirely.
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
The sample fetching goes "backward" (reverse direction of the link arrows), so if you have something like A -> B -> C, C fetches from B and B from A. Several components (NOT the blend) can do internal switch like branch selection. Take for example the checker component, the areas of color 1 input only fetches samples from that source branch.

The threshold component can be used in a more customizable way to perform smart selection of branches (or "clipping"). If you looked at the optimized version I posted of your Rock Fracture 01, you can see that I use alot of thresholds to optimize the filter. Basically you feed the threshold source with as cheap a input as possible and this way you can select different high and low sources.

Thus a filter like Crapadilla's Maze 2D would run double as fast if he performed threshold clipping of the wall layers, and he could virtually add as many wall layers as he wanted without much more overhead than calculating whats actually visible smile:dgrin:

Maze 2D - Sphinx.ffxml
  Details E-Mail
Crapadilla
lvl 52 Filter Weaver and Official "Filter Forge Seer"

Posts: 4365
Filters: 65
Quote
Sphinx. wrote:
Thus a filter like Crapadilla's Maze 2D would run double as fast if he performed threshold clipping of the wall layers, and he could virtually add as many wall layers as he wanted without much more overhead than calculating whats actually visible Devil Grin


Very, very interesting... your mod runs about 33% faster on my old machine! Gotta look into that! smile8)

I'm wondering though, would this technique also be applicable to my Wind Blur filter?

Quote
Sphinx. wrote:
The threshold component can be used in a more customizable way to perform smart selection of branches (or "clipping").


It appears you should enlighten us all with an 'Optimizing via Thresholds' wiki article? smile;)
--- Crapadilla says: "Damn you, stupid redundant feature requests!" ;)
  Details E-Mail
Crapadilla
lvl 52 Filter Weaver and Official "Filter Forge Seer"

Posts: 4365
Filters: 65
Quote
CorvusCroax wrote:
Is it better to do this NEAR the result component, or AWAY from the result component.

Quote
KGtheway2B wrote:
You'd want to put any off/on switches near the result component.


Yup, it's not called Filter Tree for no reason! smile;)

The Result component is the root of that tree, and consequently any switch components that are near the Result component tend to switch on/off bigger branches than those high up in the boughs.
--- Crapadilla says: "Damn you, stupid redundant feature requests!" ;)
  Details E-Mail
Crapadilla
lvl 52 Filter Weaver and Official "Filter Forge Seer"

Posts: 4365
Filters: 65
Quote
Sphinx. wrote:
Several components (NOT the blend) can do internal switch like branch selection.


So a masked blend would still evaluate both foreground and background inputs? In that case it would appear preferable to use threshold instead of blend whenever possible, no?
--- Crapadilla says: "Damn you, stupid redundant feature requests!" ;)
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
Quote
Crapadilla wrote:
So a masked blend would still evaluate both foreground and background inputs? In that case it would appear preferable to use threshold instead of blend whenever possible, no?


Yeah, in many cases its more optimal to use the threshold instead of the blend, even for "blending" operations.
  Details E-Mail
jffe
Posts: 2869
Filters: 90
Quote
Sphinx. wrote:
Yeah, in many cases its more optimal to use the threshold instead of the blend, even for "blending" operations.


----Sometimes it (using threshold) seems to be about the only way to get a proper layered look or *blend* of 2 components (depending on what kind of overlay type design you are working on). I didn't know it was more optimal too, guess that's just a bonus eh. smile:)

jffe
Filter Forger
  Details E-Mail
Crapadilla
lvl 52 Filter Weaver and Official "Filter Forge Seer"

Posts: 4365
Filters: 65
Made another pass over the filter... definitely an elegant solution you got there. Thanks! smile:)

Maze 2D - SphinxDilla.ffxml
--- Crapadilla says: "Damn you, stupid redundant feature requests!" ;)
  Details E-Mail
Crapadilla
lvl 52 Filter Weaver and Official "Filter Forge Seer"

Posts: 4365
Filters: 65
Quote
Sphinx. wrote:
Several components (NOT the blend) can do internal switch like branch selection. Take for example the checker component, the areas of color 1 input only fetches samples from that source branch.


So which components would that be? We've got:

* Threshold
* Checker

I'm guessing:

* Frame
* 3-Color-Gradient
* 5-Color Gradient
* Profile Gradient
* Bricks
* Pavements
* Tiles
--- Crapadilla says: "Damn you, stupid redundant feature requests!" ;)
  Details E-Mail
Crapadilla
lvl 52 Filter Weaver and Official "Filter Forge Seer"

Posts: 4365
Filters: 65
Quote
CorvusCroax wrote:
So, working on a filter last week, I found myself wondering what 'direction' FF operations happen in, and how it impacts speed. Does it work moving toward the result component, or does it work backwards from the result component?


Croax, you might want to read this thread from start to finish, if you haven't yet. In that thread we discuss - pretty in-depth - how FF samples and caches samples. Vladimir also chimes in and elaborates on our assumptions. Very interesting read that still waits to have a wiki article distilled from it! smile;)
--- Crapadilla says: "Damn you, stupid redundant feature requests!" ;)
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
Quote
Crapadilla wrote:
* Threshold * Checker

I'm guessing:

* Frame * 3-Color-Gradient * 5-Color Gradient * Profile Gradient * Bricks * Pavements * Tiles


The gradients seem to fetch all color inputs no matter the curve type (i.e. a sharp step curve wont divide the sourcefetching corresponding to the areas).

The thing about the checker is that you can use it to cache constant values like the rotation construction you use in the Maze 2D filter. Using solid fill and as large checkers as possible (Repeat H/V = 1), the sample for a given quadrant will only be fetched once. This method works best if the branch does not undergo drastic distortions, because what we utilize here is the assumption that the rasterization is performed from top left to bottom right in a scanline progressive manner (or roughly close to that).

The optimal component for this kind of use would be one that only fetches one sample for the complete rendering (i.e. the first sample is used during the rest of the rendering), but we don't have that.

All components that have a solid fill option can theoretically be used for caching constant values - the checker component seems to be the fastest though.


Quote
Crapadilla wrote:
Croax, you might want to read this thread from start to finish, if you haven't yet. In that thread we discuss - pretty in-depth - how FF samples and caches samples. Vladimir also chimes in and elaborates on our assumptions. Very interesting read that still waits to have a wiki article distilled from it! Wink


Ahh that thread discussion was really good - I just reread the whole thing.. I like how we start from total ignorance regarding the sample cache, and end up finding out all sorts of interesting things about the system smile:)

I'll see if I can find some time for updating the wiki.. no promises though!
  Details E-Mail
Crapadilla
lvl 52 Filter Weaver and Official "Filter Forge Seer"

Posts: 4365
Filters: 65
Quote
Sphinx. wrote:
I like how we start from total ignorance regarding the sample cache, and end up finding out all sorts of interesting things about the system Smile


smile:D

Yeah, that was a very intructive discourse. Sample Caching is one of those technical intricacies of FF that should really be discussed in the help file, IMO.
--- Crapadilla says: "Damn you, stupid redundant feature requests!" ;)
  Details E-Mail
CorvusCroax
CorvusCroax

Posts: 1227
Filters: 18
Quote
Crapadilla wrote:
Croax, you might want to read this thread from start to finish, if you haven't yet. In that thread we discuss - pretty in-depth - how FF samples and caches samples. Vladimir also chimes in and elaborates on our assumptions.


Whoa... read it, yes. Understand it: no. Your wiki page makes much more sense to me. LINK

Quote
KGtheway2B wrote:
The threshold component can be used in a more customizable way to perform smart selection of branches (or "clipping").


So, buy using threshold to blend, you don't calculate then unseen bits, but using blends it is all calculated? That seems like a pretty major difference...

You know, it would be great to have some kind filter speed score within the Filter Forge filter editor. Just a benchmark standard, to help people learn how things are made more efficient.
  Details E-Mail
CorvusCroax
CorvusCroax

Posts: 1227
Filters: 18
Quote
Crapadilla wrote:
The Result component is the root of that tree, and consequently any switch components that are near the Result component tend to switch on/off bigger branches than those high up in the boughs.


Excellent! I have a filter to change...
  Details E-Mail
CorvusCroax
CorvusCroax

Posts: 1227
Filters: 18
Quote
Sphinx. wrote:
The sample fetching goes "backward" (reverse direction of the link arrows), so if you have something like A -> B -> C, C fetches from B and B from A. Several components (NOT the blend) can do internal switch like branch selection. Take for example the checker component, the areas of color 1 input only fetches samples from that source branch.


Aha. Good info. This article, which you wrote explaining it, is very helpful btw: LINK
  Details E-Mail
CorvusCroax
CorvusCroax

Posts: 1227
Filters: 18
This is also a good newbie tip from that same article:

Quote
"the 'closer' prominent (i.e. often-used) filter controls are located to the filter's Result component, the more interactive the filter becomes."


I've been putting all my filter controls way at the beginning, typically with the noise components. (oops)
  Details E-Mail
Crapadilla
lvl 52 Filter Weaver and Official "Filter Forge Seer"

Posts: 4365
Filters: 65
Quote
CorvusCroax wrote:
I've been putting all my filter controls way at the beginning


Sometimes that can't be avoided... smile;)
--- Crapadilla says: "Damn you, stupid redundant feature requests!" ;)
  Details E-Mail
Crapadilla
lvl 52 Filter Weaver and Official "Filter Forge Seer"

Posts: 4365
Filters: 65
Quote
CorvusCroax wrote:
Whoa... read it, yes. Understand it: no. Your wiki page makes much more sense to me.


Yup, same with me! smile;) smile:D
--- Crapadilla says: "Damn you, stupid redundant feature requests!" ;)
  Details E-Mail
rgoer
Posts: 46
Sorry for the naïve interruption here, but would somebody mind explaining exactly what you mean by using threshold for blending?
  Details E-Mail
CorvusCroax
CorvusCroax

Posts: 1227
Filters: 18
rgoer:

You set image 1 to be the 'high' part of the threshold, and then set image 2 to be the low part of the threshold. Then you use some other thing (like a gradient, noise or map input) for to tell which goes where. Turns out it's faster than blending becasue FF only calculates the parts you see, whereas blend calculates all of it (1 time for each blended input.)

check out this link>>LINK<<
  Details E-Mail
Crapadilla
lvl 52 Filter Weaver and Official "Filter Forge Seer"

Posts: 4365
Filters: 65
Quote
rgoer wrote:
Sorry for the naïve interruption here, but would somebody mind explaining exactly what you mean by using threshold for blending?


This might help clear some things up. Scroll down to the example with the smilies... smile;)
--- Crapadilla says: "Damn you, stupid redundant feature requests!" ;)
  Details E-Mail
KGtheway2B
KGtheway2B

Posts: 660
Filters: 34
Wow, and all this time I've been using set alpha + blend smile:blush:
  Details E-Mail
ThreeDee
Lost in Space

Posts: 1672
Filters: 112
I've started to use threshold for blending purposes now. Good stuff. In many cases it cuts out extra steps I've been putting in.
  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
+36 new in 30 days!

15,347 Topics
+72 new in year!

Create an Account

Online Users Last minute:

124 unregistered users.