[Radiance-general] Depth-of-field hack

Mark Stock mstock at umich.edu
Wed Aug 18 22:27:28 CEST 2004


Peter,

Thank you for your comments. I hope the following response
will be helpful.

On Mon, 16 Aug 2004, Peter Apian-Bennewitz wrote:
> >
> >I first tried pdfblur, which outputs a series of views, each
> >of which can be rendered with rpict or created with pinterp.
> >
> I'm not quite sure I see the light here yet, but I'm interested, as
> rshow had some experimental features of generating the views (actually
> before realizing there are some cmdline tools buried deeply somewhere),
> that's how the lower image at
> http://www.pab-opto.de/radiance/render_vergleich/intro.htx was rendered
> with 16 single views.

Right, that seems to be the method that pdfblur uses: creates a
number of different views, each of which you need to create using
either rpict or pinterp.

> Before decompiling the rcalc script, could you briefly say why your
> method is faster ?

It is faster for a certain class of problems: very
high-resolution images with significant depth-of-field effects.
Its advantage lies in the fact that no sharp renderings are ever
created---those sharp renderings cause the wispy sharp lines in
the image you refer to, and one image that I linked to.

The rcalc script borrows heavily from the rcalc expression
inside of the pdfblur script. Where the pdfblur script applies
depth-of-field blur on an image-wise basis, my command-line
version applies it on a pixel-by-pixel basis.

> To give a hint of the little bits I do understand: Out-of-focus pixels
> average over a larger solid angle as in-focus ones. Even the solid-angle
> of in-focus pixels is truly not zero, that's why we need oversampling to
> avoid aliasing. Traditional methods calculate anti-aliased images with
> shifted view points and directions which are than added to give the
> blurred final result. Do I understand correctly that your method
> incorporates the depth-of-field information into the per-pixel averaging
> over the per-pixel-solid-angle ? Speed advantage would than come by
> avoiding unnecessary rays. Is there an easy way to understand how ?

Using pdfblur with pinterp, you *do* only resample pixels in
areas where the blur effect is significant, thus saving time.
This method, though, is not compatible with the "-aa 0 -ps 1"
method that I presented earlier. This is because using -aa 0
with a very low -ad value (4 or 8) gives very noisy images,
and the entire image must always be oversampled in order to
obtain smooth final images. With the understanding that the
entire image needed to be resampled many times, I wanted a
DOF method that would be noisy on a pixel-basis, but that would
smooth out when the image size was filtered down.

> With the old method, each of the images has the same size, so one pixel
> is effectively oversampled by the number of images. Whether in-focus or
> not. Are you saying that the out-of-focus ones need more sampling than
> the in-focus ones ? And the in-focus don't gain much from the higher
> sampling ?

This is true for non-noisy images (with high settings for
-ad and -as), and it the aim of pdfblur with pinterp, but
is not the case for the very-high-resolution, noisy images
that dominate my recent work. The most recent production
image that I made was at 24,000^2 resolution, and used
rather low-quality ambient value settings. After appropriate
size reductions, a very fine quality 7200^2 image resulted.

Note that because every pixel is resampled, I could very
easily have rendered a larger number of images at the
final resolution (7200^2) instead of one very large one.
I may shift to that method in the future.

> PS: nice Radiance webpages of yours

Thanks! It's taken me a bit of time to assemble the material that
is there, but there is ever more that I'd like to share. Within
the next half-year, I hope to have a website up for my digital
visual art, most of it created with Radiance. I'll be sure to
notify the list when that happens.

Mark



More information about the Radiance-general mailing list