CommonFilters - some new filters, and the future

Desaturation (monochrome) filter continued.

Perhaps the most interesting feature of the desaturation filter is the hue bandpass. An arbitrary reference RGB colour is given to the filter, and it extracts the HSL hue from this colour. Then, when the filter is running, it computes the HSL hue of each pixel, and compares it to the reference hue. If it is “close enough” (the falloff is configurable), the filter weakens the desaturation for that pixel.

The result is that it is possible to keep, for example, only the reds, while desaturating the rest:


In this filter all other parameters are genuine runtime parameters (enabling realtime fades), but enabling or disabling the hue bandpass invokes a shader recompile. (The reference colour can be changed without invoking a recompile.)

Finally, the desaturation filter with tinting combines with the scanlines filter to produce an old computer monitor look:


The scanline thickness is configurable (in pixels, integer), as is the choice of whether to keep the top or bottom field. The field that is processed (not kept) is darkened by a configurable factor, which generally looks much better than making it completely black.

That’s all folks!