Filter Construction: Avoiding Bitmap-Based Components

From Filter Forge Wiki

Revision as of 06:11, 9 August 2008; view current revision
←Older revision | Newer revision→
Jump to: navigation, search

Contents


This chapter of The DOs and DON'Ts of Filter Construction deals with the reasons why it is (usually) best to not have rasterized at all within your filters.

Be sure to study the article on Bitmap-Based Components for a technical primer on these components, and why they should generally be avoided unless absolutely needed!

Noise and Blur

Image:Noise and blur 01.jpg

Consider the example above, a classic DON'T: A Perlin Noise with both Details and Roughness set to 100 is being fed into a blur component. The Details and Roughness values force FF to generate many small-grained noise octaves, which slow down the rendering, yet all the fine detail is lost in the subsequent Blur.

<<< RED ALERT >>> ABANDON ALL HOPES OF EDITOR'S PICKS ALL YE WHO CONSTRUCT YOUR FILTERS THUSLY!!! <<< RED ALERT >>>

Image:Noise and blur 02.jpg

The Perlin Noise in the second example above has been tweaked to approximate a smoothly blurred result without the use of a Blur component, simply by drastically reducing the Detail and Roughness values. Also note that the Noise and Background colors have been slightly changed to achieve a similar contrast. Not only is this result visually equivalent to our first example, it is also much faster.

Image:Noise and blur 03.jpg

As is apparent in the third example above, the result of blurring a worley noise is often visually equivalent to a low-detail Perlin Noise, so usually, this is another DON'T! As a rule of thumb, whenever you feel like using a Blur on a noise component, be sure to check whether you can achieve the same result with a regular Perlin Noise.

-- Crapadilla


Noise and Motion Blur

Image:Noise and motion blur 01.jpg

An example of bad filter construction: A Perlin Noise fed into a Motion Blur component. Note how the contrast is diminished by the blur operation.

Image:Noise and motion blur 02.jpg

The proper way to do it: Make use of the Stretch and Angle parameters of the Perlin Noise, as this is much more efficient!

Image:Noise and motion blur 03.jpg

Note how a motion-blurred worley noise shows only minor visual differences in comparison to a stretched Perlin Noise. This is another case of bad construction that should be avoided!

-- Crapadilla


Patterns, Gradients, Frames and Blur

Image:Tiles and blur 01.jpg

While feeding a pattern component into a Blur isn't bad per se, having Blur components around in the first place usually is! As we will see below, there is a way to get rid of this particular Blur, and being able to get along without resorting to blurring anything is usually a Good Thing (tm) for any filter!

Image:Tiles and blur 02.jpg

Huh?! The Tiles look blurred yet there is no Blur? Yup! Always be sure to know the capabilities of the components you use. In this case we used the Bevel Width parameter to create a smooth gradient falloff on the Tiles, as it visually approximates the blur quite well. Do I need to repeat it is also faster? ;)

Image:Tiles and blur 03.jpg

Since Bricks, Pavements, Frame and Profile Gradient components all posess the native ability to simulate smooth gradients, always be sure to experiment before you pipe these into a Blur... Most likely, you can save yourself some rendertime! To this end, also do not neglect the blue curve profile inputs on these components for additional control over these gradients.

Image:Tiles and blur 04.gif

Consider the case shown above where the objective was to create a drop-shadow for the red tiles. While the Blur component does render rather quickly with the Tiles as a source, it is still superfluous. The blur 'effect' can be created natively on the Tiles component itself!

Image:Tiles and blur 05.gif

Here is how it is done correctly: Use the Bevel Width parameter of the Tiles component to create a smooth gradient transition from a completely transparent to a completely opaque alpha.

Image:Tiles and blur 06.gif

Since we are always striving to be Captain Efficient Incarnate when constructing filters, we might as well simplify this further while we're at it. Remember the 'Art of Blending'? Well here's a case where we can get rid of a Blend component while still blending stuff. ;)

Filters suitable for further studies on this subject are:


-- Crapadilla


Chaining Bitmap-Based Components

Image:Sharp blur and blurred sharpen.JPG

Chaining Bitmap-Based Components together is likely one of those stunts that a filter author should never ever pull. Really, not only do these blur trains derail quickly due to their inherently nonsensical nature, they can also get you publicly shot, drowned, quartered, and worse! An absolute No-Go!

-- Crapadilla


High-Pass Vs. Threshold

Image:Threshold vs highpass 01.jpg

A High Pass with a high Contrast setting is visually comparable to the result of a Threshold component, yet the Threshold is many times faster (and it does not incur the 'first block delay' that makes Bitmap-Based Components so slow when interactively tweaked). So, if you are after this sort of 'grungy' visuals, always explore the possibilities of Thresholds before resorting to a High Pass.

-- Crapadilla


Personal tools