POV-Ray : Newsgroups : povray.programming : New approach to depth-of-field (focal blur)? Server Time
22 Dec 2024 07:39:58 EST (-0500)
  New approach to depth-of-field (focal blur)? (Message 1 to 1 of 1)  
From: IanT
Subject: New approach to depth-of-field (focal blur)?
Date: 30 Nov 2005 23:55:00
Message: <web.438e81b2398ff5aefc08eec00@news.povray.org>
Hi all,

First of all, this is my first post here, hopefully not the last ;-)

I've been dabbling with writing a java ray tracer for the past couple of
months (more to bolster my java skills rather than writing anything
to rival anything else) and one thought occurred to me as I was finishing
off my depth-of-field code...

The common approach to depth-of-field is obviously to send primary rays
out in a cone with the individual rays scattered randomly within this cone.
Using around 50-100 samples usually gives non-noisy results (depending on
aperture size/focal length etc.) but leads to PAINFULLY long render times.

I was wondering if anyone has ever considered the following...

Given that, in the real world, a single point of light in reality leads to
a single disc of attenuated light on the film.  In theory, instead of the
main "traceRay" method returning a colour, could we have it return a list
of collision points, along with the following:-

- effective distance from the eye (by "effective" I mean the total path
length)
- curvature of the surface at the collision point.

Given this list, for each collision point, paint a disc on the final image
(centred on the target pixel) and attenuate it based on its area relative to
the area of a pixel.  Assuming that such painting is done in an additive way
then, for example, a ray that strikes a semi-diffuse/semi-reflective object,
followed by a fully-diffuse object, should return two collision points, each
of which will result in a different-sized disc painted on the image.

Given such a scheme, the performance of this should degrade proportionally
with
the ray depth rather than the "quality" of the depth-of-field simulation.

The tricky bit will be determining surface curvature at the collision point
and working out how this affects the size of the corresponding disc (I would
imagine a point reflected off a highly-curved surface will appear to be
further
away than from a flat surface therefore requiring a bigger disc).

Am I just talking about something that's been tried before or might it work?

Any feedback appreciated before I dive in and start coding...

Ian.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.