YOUR ACCOUNT

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

Posts: 1750
Filters: 39
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
Further information that couldn't fit in the description field:

The blur module is a bitmap based filter, which means that in order for it to work, it must rasterize (render) its input to an internal bitmap. We don't want the actual blurring, but setting the radius to 0 makes the module bypass itself (hence no rasterization), so we need to set it to the minimum instead: 0.0000001

Now every module connected to the output of that blur will draw samples from the blur components internal bitmap and not its input smile;-)

Since the blur module process red, green, blue and alpha, you can use this advantage to buffer several independant grayscale sources in one blur (look at the construction of the snippet).

The method has some sideeffects you should be aware of:

* Increased initialization time
Typically you'll see a slow start because the internal bitmap is being rasterized, but when that step is over (typically after a few rows of rendering), it'll fly!

* Increased memory usage
Because of the internal bitmaps, the memory usage will grow significantly. Be aware that the global FF configuration

* No real subpixel samples
Because the rasterized bitmap is same size as the output image, subpixel sampling (antialias) will fetch interpolated samples inbetween pixels. If sample for pixel 1 is black and sample for pixel 2 is white, all subsamples will be within this range (i.e. shades of gray). This means that high frequency inputs (like a perlin with high roughness), might not render out as crispy as they normally would.
Plugging the buffer blur output into refractions, offsets and noise distortions can of same reason also result in different results.
If you dare, you could experiement with the "Anti-alias sources for bitmap-based components" option in FF, but this will most probably negate out the speed-up advantage.

Understanding how this works and being aware of these sideffects is important. Also try to limit the amount of user controls for things going into the blur buffer - if possible use alternate "post blur" constructions as this will give very good control response for the user (since the blur doesn't need to update when its input is unchanged). Again look at the two controls in the snippet - they are placed after the blur, making their response changes render very fast.
  Details E-Mail
Carl
c r v a

Posts: 7289
Filters: 82
Very interesting Michael I'll have to give it a run in a filter smile:)
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
With my recent Cell Leather filter I tried submitting twice, rejected both times because it was too slow.. So I applied this buffering method, which made a huge difference (its quite fast now)..

And actually the first submit of the buffer filter snippet were rejected too, because I included *one* reference preset without buffering smile:D
  Details E-Mail
ronviers
lighter/generalist

Posts: 4456
Filters: 35
This looks like a real breakthrough.
When I get some time I will try it on my turquoise texture. It would be great if it worked for that one – I spent weeks working it out.
Thanks a lot for this excellent snippet. smile:)
@ronviers
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
If the small offset issue (I think its a bug) with the Motion Blur doesn't matter, you should definitely use Motion Blurs for buffering (faster than normal blur).

I think the blur module fetches 9 (maybe just 5) samples per rasterized sample in the internal blur bitmap for even the lowest radius. Whereas the motion blur only fetches 3.
Ideally the method only requires one sample (that would be very fast), but unfortunatly there is no way to make that happen, since one sample in a blur filter equals radius = 0, and radius = 0 makes the blur filter bypass itself (seems its bitmap is not created here).
  Details E-Mail
ronviers
lighter/generalist

Posts: 4456
Filters: 35
I wonder if the offset and refraction components would work too.
@ronviers
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
Quote
ronviers wrote:
I wonder if the offset and refraction components would work too.


No, only bitmap based components - Blur, Motion Blur and High Pass, where motion blur is the one best suited due to the lower sample fetching.
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
I can't stress enough that you should be aware of the sideeffects, and that the method directly opposes the procedural sampling concept of FF, so use it when it works for you, and not as a universal wonder trick! .. and always include an option for the user to disable it, as a true procedural chain will give better details when antialiased.
  Details E-Mail
ronviers
lighter/generalist

Posts: 4456
Filters: 35
Quote
Sphinx. wrote:
only bitmap based components

Ok. I remember uberzev is often using refraction and offset set to zero in his snippets and I was just thinking that maybe they were working on the same princple. Thanks for the clarification.
This sure is cool.

Quote
Sphinx. wrote:
include an option for the user to disable it, as a true procedural chain will give better details when antialiased


understood smile:)
@ronviers
  Details E-Mail
Carl
c r v a

Posts: 7289
Filters: 82
With your understanding of all this I'm curious what your field is smile:)
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
Quote
ronviers wrote:
Ok. I remember uberzev is often using refraction and offset set to zero in his snippets and I was just thinking that maybe they were working on the same princple


Interesting! Which of his filters does this? Need to check that out.. learned alot about FF from his snippets already - amongst others the fact that FF rounds control values < 0.005 to 0.00, which also explains why the checkbox for the blur modules in my snippet shows 0.00 (checked) and 0 (unchecked).. which ofcourse is not correct, should be 0.00000001 (or something) and 0.

Quote
Carl wrote:
With your understanding of all this I'm curious what your field is


Its the field of nerd smile:D Been programming graphics stuff for some years now (I'm co-developer on Graphics32, an opensource graphics library for Delphi and C++ Builder)
  Details E-Mail
ronviers
lighter/generalist

Posts: 4456
Filters: 35
Quote
Sphinx. wrote:
Which of his filters


'Proportional Gradient' uses the offset component while the snipped called 'Moveable Spokes' in this thread:

http://www.filterforge.com/forum/read...ssage20929

uses the refraction component.
@ronviers
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
Quote
ronviers wrote:
'Proportional Gradient' uses the offset component while the snipped called 'Moveable Spokes' in this thread:

http://www.filterforge.com/forum/read...ssage20929

uses the refraction component.


Hmm.. can't see any "set to zero" settings in those.. both seem to utilize the extreme zoom in capabilities of the offset component. The spokes in the Moveable Spokes filter comes from zooming in alot on the refraction output, if you try zooming even more in (49.999 or something) you'll see that the seemingly infinite vanishing point is not infinite..
  Details E-Mail
Carl
c r v a

Posts: 7289
Filters: 82
Quote
Sphinx. wrote:
Graphics32

Had a look - fascinating/complex well beyond my scope of knowledge - I can see the tie in with speed efficency smile:) I didn't think Danish politics was that bad but I guess it's a universal problem - it doesn't matter who you vote for a politicans going to win smile;)
  Details E-Mail
ronviers
lighter/generalist

Posts: 4456
Filters: 35
Quote
Carl wrote:
can't see any "set to zero"

This cap is from the proportional gradient filter. What does the offset do?

@ronviers
  Details E-Mail
ronviers
lighter/generalist

Posts: 4456
Filters: 35
And this cap is from the filter snippet called 'Temp' from the thread mentioned earlier but further down (sorry about that). What is the refraction doing?

@ronviers
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
Quote
ronviers wrote:
This cap is from the proportional gradient filter. What does the offset do?


ahh... its the invert offset blend emboss trick - here it creates the minimum vertical offset possible, which then is mixed with the inverted offset source and threshold to create an invert mask. The attached filter shows whats going on, only here I adjusted the numbers to get a visible range..

invert offset emboss.ffxml
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
Quote
ronviers wrote:
And this cap is from the filter snippet called 'Temp' from the thread mentioned earlier but further down (sorry about that). What is the refraction doing?


Hmm.. it seems to do nothing? Do I miss something here? Its input is already consisting of spokes, and these seem to be unaltered in the output.. which makes sense, since the heightmap is fully flat and moreover the refraction scale is zero..
  Details E-Mail
ronviers
lighter/generalist

Posts: 4456
Filters: 35
Quote
Sphinx. wrote:
its the invert offset blend emboss trick

That gives me a lot to think about. Thanks for the explanation. smile:)

Quote
Sphinx. wrote:
it seems to do nothing

I see my mistake - sorry. smile:(

temp.ffxml
@ronviers
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
Ron, I still don't understand what purpose that refraction in the top serves.. If I bypass it and takes its input to where its output goes, I get the same rendering at the same speed... I feel I'm missing something here..still looks to me that it does nothing
  Details E-Mail
ronviers
lighter/generalist

Posts: 4456
Filters: 35
Quote
Sphinx. wrote:
still looks to me that it does nothing


Yes, I'm very sorry about this Michael, as I mentioned in the previous post I made a mistake and never should have posted the question. I will try to be more careful about asking dumb questions in the future. Thank you for taking a look at it.
@ronviers
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
ah..sorry, misunderstood... I thought it was the attachment that was wrong since you added a new one smile:) Anyways.. no dumb questions.. only dumb answers smile;)
  Details E-Mail
ronviers
lighter/generalist

Posts: 4456
Filters: 35
Quote
Sphinx. wrote:
I thought it was the attachment that was wrong

I see the ambiguity now. Actually I added the attachment with another post but then noticed my mistake and was unable to remove the attachment after I edited the post. I did not realize how it would read after the edit.

Quote
Sphinx. wrote:
no dumb questions.. only dumb answers

This was the exception that proves the rule. smile:blush:
@ronviers
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
Quote
Sphinx. wrote:
I think the blur module fetches 9 (maybe just 5) samples per rasterized sample in the internal blur bitmap for even the lowest radius. Whereas the motion blur only fetches 3.
Ideally the method only requires one sample (that would be very fast), but unfortunatly there is no way to make that happen, since one sample in a blur filter equals radius = 0, and radius = 0 makes the blur filter bypass itself (seems its bitmap is not created here).


Forget this one.. I'm pretty convinced that no more than one sample is fetched per output sample - unless "Anti-alias sources for bitmap-based components" is enabled in the FF options. However the Motion Blur still seem to initialize faster.
  Details E-Mail
uberzev
not lyftzev

Posts: 1890
Filters: 36
This is a great idea Sphinx. I was thinking about posting a feature request for a "rasterize now" component, but you seem to have achieved that functionality with this workaround.

:cool:
  Details E-Mail
SpaceRay
SpaceRay

Posts: 12298
Filters: 35
cool and this seems to be useful and interesting, but do not know how to use it, will have to see more about this.
  Details E-Mail
David Roberson
Artist
Posts: 404
Filters: 36
Quote
Sphinx. wrote:
Ideally the method only requires one sample (that would be very fast), but unfortunatly there is no way to make that happen, since one sample in a blur filter equals radius = 0, and radius = 0 makes the blur filter bypass itself (seems its bitmap is not created here).


Is this true, in the sense that FF completely ignores the Blur component? I had hoped, having read this comment recently, that using a control setting Blur Radius to 0 would prevent FF from trying to initialize the bitmap, preventing that annoying 5 second or more lag at the start of a filter. Like threshold clipping and switching, it did not seem to have that effect; which is sad, because it makes the "responsive layout" portion of my filter virtually useless.

Short of going in and manually disconnecting and bypassing the bitmap based components, there's no way to get around that bottleneck.

Is there something else that would do it I haven't heard of yet?
  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:

357 unregistered users.