POV-Ray : Newsgroups : povray.general : Regarding the defocus module Server Time
31 Oct 2024 14:09:46 EDT (-0400)
  Regarding the defocus module (Message 1 to 8 of 8)  
From: udyank
Subject: Regarding the defocus module
Date: 4 Aug 2016 10:20:00
Message: <web.57a34ea5da2f2d53f2ed086a0@news.povray.org>
I have some doubts on how the defocus module is actually working. On which plane
is the jittering of rays happening? And how is it able to produce realistic
images without the concept of a lens?
And also, the POVRay doc on the aperture setting says that "the zone of
sharpness is a plane through the focal_point and is parallel to the camera". How
is that? Is the plane is along depth(Z), ie horizontal, or parallel to camera
(vertical) ?


Post a reply to this message

From: clipka
Subject: Re: Regarding the defocus module
Date: 4 Aug 2016 11:53:57
Message: <57a36515$1@news.povray.org>
Am 04.08.2016 um 16:18 schrieb udyank:
> I have some doubts on how the defocus module is actually working. On which plane
> is the jittering of rays happening? And how is it able to produce realistic
> images without the concept of a lens?

I presume you're talking about focal blur.

In POV-Ray, focal blur is implemented by jittering the actual origin of
the rays vertically and horizontally perpendicular to the camera axis,
typically in a circular region. At the same time, the direction of the
rays is adjusted in the opposite direction, so that each ray still
passes through the same point on the plane of sharpness that it would
have passed through without the jittering.

To compare this with a real camera lens, the camera location can be
thought of as the center of the diaphragm (or, more precisely, the
diaphragm's virtual image as seem through the lens), and the jittering
of the rays accounts for the fact that the diaphragm's aperture is not
infinitesimally small.

Virtually the only difference to the image of a real camera lens is that
POV-Ray's algorithm by default results in a perfectly circular and
uniform bokeh (provided you use high enough focal blur quality
settings), while the bokeh of real camera lenses often approaches that
of a polygon, and in special lense types may even be somewhat circular
or even non-uniform in brightness. To mimick such effects, POV-Ray
provides the `bokeh` camera setting, which lets you use a pattern to
define the shape of the aperture.

> And also, the POVRay doc on the aperture setting says that "the zone of
> sharpness is a plane through the focal_point and is parallel to the camera". How
> is that? Is the plane is along depth(Z), ie horizontal, or parallel to camera
> (vertical) ?

The zone of sharpness is a plane. As such, it is /both/ horizontal /and/
vertical, parallel to the camera [image], or in other words
perpendicular to the camera axis.


Post a reply to this message

From: udyank
Subject: Re: Regarding the defocus module
Date: 4 Aug 2016 12:25:01
Message: <web.57a36bf429233825f2ed086a0@news.povray.org>
> At the same time, the direction of the
> rays is adjusted in the opposite direction, so that each ray still
> passes through the same point on the plane of sharpness that it would
> have passed through without the jittering.

Are you saying that we presume there is a finite-aperture lens in the middle b/w
the camera plane and the scene, which bends the rays? Supposing there is a lens
in the middle, the rays from the camera bend through the lens and go to the
scene at some point P, does the "adjustment" mean that all jittered rays will
also go through P or points scattered around P (as per the jitter on the other
side) ?

> To compare this with a real camera lens, the camera location can be
> thought of as the center of the diaphragm (or, more precisely, the
> diaphragm's virtual image as seem through the lens), and the jittering
> of the rays accounts for the fact that the diaphragm's aperture is not
> infinitesimally small.

I didn't really get this part. How would jittering account for the aperture
size? Would it be possible for you to explain this with the help of an image?
It would be really helpful.

Thanks


Post a reply to this message

From: clipka
Subject: Re: Regarding the defocus module
Date: 4 Aug 2016 12:59:07
Message: <57a3745b$1@news.povray.org>
Am 04.08.2016 um 18:23 schrieb udyank:
>> At the same time, the direction of the
>> rays is adjusted in the opposite direction, so that each ray still
>> passes through the same point on the plane of sharpness that it would
>> have passed through without the jittering.
> 
> Are you saying that we presume there is a finite-aperture lens in the middle b/w
> the camera plane and the scene, which bends the rays? Supposing there is a lens
> in the middle, the rays from the camera bend through the lens and go to the
> scene at some point P, does the "adjustment" mean that all jittered rays will
> also go through P or points scattered around P (as per the jitter on the other
> side) ?

I'm not sure if we're saying the same.

Note that in a somewhat idealized lens camera, all light rays from (or
passing through) an arbitrary point P on the plane of sharpness meet at
a specific point P' on the image plane, but they might pass through any
other arbitrary plane through different points Q_i.

POV-Ray picks such an arbitrary plane parallel to the image plane (and
also parallel to the plane of sharpness), and jitters the point Q_i,
while keeping constant both P' (which is trivial because it's the pixel
currently being rendered) and P (which requires some math but isn't too
difficult).

Where that arbitrary plane is located doesn't really matter; it could
indeed be the plane of the lens. However, it makes sense to instead
pretend that it's the plane of the diaphragm, since it's the size of the
diaphragm that corresponds to the jitter radius.

The only conceptual problem there is that the diaphragm is usually
somewhere between the physical lenses within the lens assembly, so
instead of the physical diaphragm the truly relevant entity is the
"virtual diaphragm", i.e. the diaphragm as and where it appears to be
when seen through the front of the lens assembly.

>> To compare this with a real camera lens, the camera location can be
>> thought of as the center of the diaphragm (or, more precisely, the
>> diaphragm's virtual image as seem through the lens), and the jittering
>> of the rays accounts for the fact that the diaphragm's aperture is not
>> infinitesimally small.
> 
> I didn't really get this part. How would jittering account for the aperture
> size? Would it be possible for you to explain this with the help of an image?
> It would be really helpful.

I'll try to throw together something.


Post a reply to this message

From: clipka
Subject: Re: Regarding the defocus module
Date: 4 Aug 2016 20:13:34
Message: <57a3da2e$1@news.povray.org>
Am 04.08.2016 um 18:59 schrieb clipka:

>> I didn't really get this part. How would jittering account for the aperture
>> size? Would it be possible for you to explain this with the help of an image?
>> It would be really helpful.
> 
> I'll try to throw together something.

See povray.binaries.images


Post a reply to this message

From: Bald Eagle
Subject: Re: Regarding the defocus module
Date: 5 Aug 2016 08:10:00
Message: <web.57a4819429233825b488d9aa0@news.povray.org>
https://en.wikipedia.org/wiki/Depth_of_field

There's a little bit of graphical explanation here:

https://en.wikipedia.org/wiki/Depth_of_field

Ansel Adams made a trilogy of quite excellent books on the camera, the film, and
the print.   He explains everything very well in my opinion.   Perhaps there is
something you can find on the web, but the relevant search terms would be "depth
of field" and "circle of confusion".


Post a reply to this message

From: udyank
Subject: Re: Regarding the defocus module
Date: 12 Aug 2016 03:00:00
Message: <web.57ad739329233825f2ed086a0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 04.08.2016 um 18:59 schrieb clipka:
>
> >> I didn't really get this part. How would jittering account for the aperture
> >> size? Would it be possible for you to explain this with the help of an image?
> >> It would be really helpful.
> >
> > I'll try to throw together something.
>
> See povray.binaries.images

I saw the images forum post. Your explanation with the image and the further
posts really helped clarify almost all of the doubts I had been having with
POVRay's focal blur module. Thanks for all your help.

Although I still have that last doubt on how you decide the virtual aperture's
location.


Post a reply to this message

From: udyank
Subject: Re: Regarding the defocus module
Date: 12 Aug 2016 03:25:01
Message: <web.57ad799029233825f2ed086a0@news.povray.org>
"udyank" <nomail@nomail> wrote:
> clipka <ano### [at] anonymousorg> wrote:
> > Am 04.08.2016 um 18:59 schrieb clipka:
> >
> > >> I didn't really get this part. How would jittering account for the aperture
> > >> size? Would it be possible for you to explain this with the help of an image?
> > >> It would be really helpful.
> > >
> > > I'll try to throw together something.
> >
> > See povray.binaries.images
>
> I saw the images forum post. Your explanation with the image and the further
> posts really helped clarify almost all of the doubts I had been having with
> POVRay's focal blur module. Thanks for all your help.
>
> Although I still have that last doubt on how you decide the virtual aperture's
> location.

Sorry I didn't see the last post. Got it now. Thanks again!


Post a reply to this message

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