|
![](/i/fill.gif) |
Am 11.11.2010 16:10, schrieb Tek:
> After some testing I'm getting the impression that the bokeh filter isn't
> strictly applied. I'm getting square shapes when using a bokeh which is mostly
> black, as if the algorithm gives up after a few tries and just uses the sample
> anyway. Indeed, using a completely black bokeh filter doesn't cause any error
> and I still have blur.
This is indeed the case; the design of the algorithm was subject to the
following constraints:
* allow the use of an arbitrary user-specified bokeh (as opposed to a
set of hard-coded bokehs)
* allow the use of POV-Ray's pattern mechanism (as opposed to requiring
an image file)
* produce the same output image brightness regardless of the bokeh
pattern's average brightness (for instance a circular black-and-white
"mask" would typically have an overall brightness of pi/4, while a
regular hexagonal one might have an overall brightness of 3*sqrt(3)/8)
* use importance sampling to get more quality out of a given number of
samples
All in all this calls for a monte-carlo approach at choosing sampling
points, with some variation to make it robust against pathological cases
- not only the (impossible-to-detect) case of an all-black bokeh
pattern, but also e.g. an almost-all-black pattern where the combined
choice of sample-candidate stream (in this case 2D Halton) and monte
carlo pseudo-RNG happens to never find a suitable sample.
The current solution to the robustness issue is to monitor how well the
algorithm is getting along at choosing samples, and adaptively brighten
up the pattern a bit.
> This is an understandable limitation of the bokeh filter implementation, but it
> limits my ability to use it to randomize blur samples.
Not really: Any pattern utilizing high-frequency random noise with an
overall brightness around 0.5 (in the regions that should be part of the
bokeh) should do the trick; for instance, randomly-chosen slices of a
scaled-down "bumps" pattern should do (modulated of course by the
pattern you really want to achieve).
Post a reply to this message
|
![](/i/fill.gif) |