POV-Ray : Newsgroups : povray.binaries.images : Help needed with the focal blur module Server Time
7 Nov 2024 02:26:21 EST (-0500)
  Help needed with the focal blur module (Message 1 to 10 of 13)  
Goto Latest 10 Messages Next 3 Messages >>>
From: udyank
Subject: Help needed with the focal blur module
Date: 9 Oct 2016 22:45:01
Message: <web.57fb00852e63268cf2ed086a0@news.povray.org>
I need a bit of help with the focal blur module. I am trying to render a simple
scene with 3 vertical bars in the front and 3 horizontal ones at the back. I'm
having trouble with setting the focal length in the scene (focal_point does not
seem to work for this). All the scene parameters (for eg. distances of objs from
camera, their thickness etc.) are in terms of focal length. How do I set it as a
param and use it to define all other distances? Also generally aperture in
cameras is defined as a fraction of 'f'. How does the aperture param in POVRay
correspond to real apertures defined as such?

Another doubt: As I am trying to increase the aperture and putting my
focal_point on the vertical bars in the front (ref: images in the ZIP), the bars
at the back start "splitting" into parts. Any thoughts on how this could be
happening?

Thanks in advance!


Post a reply to this message


Attachments:
Download 'blurtest.zip' (332 KB)

From: omniverse
Subject: Re: Help needed with the focal blur module
Date: 10 Oct 2016 03:20:01
Message: <web.57fb40af315ae166b1933f770@news.povray.org>
"udyank" <nomail@nomail> wrote:
> I need a bit of help with the focal blur module. I am trying to render a simple
> scene with 3 vertical bars in the front and 3 horizontal ones at the back. I'm
> having trouble with setting the focal length in the scene (focal_point does not
> seem to work for this). All the scene parameters (for eg. distances of objs from
> camera, their thickness etc.) are in terms of focal length. How do I set it as a
> param and use it to define all other distances? Also generally aperture in
> cameras is defined as a fraction of 'f'. How does the aperture param in POVRay
> correspond to real apertures defined as such?
>
> Another doubt: As I am trying to increase the aperture and putting my
> focal_point on the vertical bars in the front (ref: images in the ZIP), the bars
> at the back start "splitting" into parts. Any thoughts on how this could be
> happening?

You probably just need to improve the quality. Try using keywords  variance
with a value of 0.005 or less and  confidence  of 0.9 or more. And more
blur_samples, something like 100 or more.

I don't know much of anything about the workings of camera blur but my guess
would be the scene distances might play a big part in how the focus, or
aperture, is affected. Or vice versa. In other words, perhaps large focal_point
distances from camera location require larger aperture values to compensate.

However, from what I tried just now with it, I can't be sure there's a possible
correlation with enough to formulate what you're wanting to do. And yet there
might be something to do with scene size possible if you can constrain all
objects within a certain area of view. Distance from camera and its focal point
seem to make aperture require larger or smaller values, so if far away
focal_point then aperture increased could help.
Closer together and aperture must be smaller. I would only be guessing here, of
course, but that's what I was finding in my test scene.


Post a reply to this message

From: udyank
Subject: Re: Help needed with the focal blur module
Date: 10 Oct 2016 03:55:01
Message: <web.57fb4890315ae166f2ed086a0@news.povray.org>
> You probably just need to improve the quality. Try using keywords  variance
> with a value of 0.005 or less and  confidence  of 0.9 or more. And more
> blur_samples, something like 100 or more.
> I don't know much of anything about the workings of camera blur but my guess
> would be the scene distances might play a big part in how the focus, or
> aperture, is affected. Or vice versa. In other words, perhaps large focal_point
> distances from camera location require larger aperture values to compensate.

The blur samples I used were 500, and the images I sent were with aperture
values equal to 1, 2 and 3 respectively. As I do not know the correspondence of
POVRay's relative aperture scale with real aperture values of cameras, I'm not
able to find what value to use. Can you help with this?


> However, from what I tried just now with it, I can't be sure there's a possible
> correlation with enough to formulate what you're wanting to do. And yet there
> might be something to do with scene size possible if you can constrain all
> objects within a certain area of view. Distance from camera and its focal point
> seem to make aperture require larger or smaller values, so if far away
> focal_point then aperture increased could help.
> Closer together and aperture must be smaller. I would only be guessing here, of
> course, but that's what I was finding in my test scene.

I'm attaching my .pov file for reference. I have tried setting this up somewhere
else also, but I am not able to replicate the results in POVRay (mainly because
of the 'focal length' issue). Can you see if there is any mistake that I made
while setting it up?


Post a reply to this message


Attachments:
Download 'cmyscene.pov.txt' (2 KB)

From: omniverse
Subject: Re: Help needed with the focal blur module
Date: 10 Oct 2016 05:35:01
Message: <web.57fb5f6b315ae166b1933f770@news.povray.org>
Seems to me you are finding that the larger the aperture with near objects there
might be a limit to what's possible with quality of render. Such that a real
camera would allow a smooth transition if something were next to its lense, but
POV-Ray can't (still guessing here) retain the defocusing in a likewise smooth
manner. Hence your dividing bars problem seen before.

I suspected you might have been dealing with a large scene scale, obviously not
the case after seeing your test scene.
Mine used object to camera distances of 10 and 100 POV Units, and since then I
have tried weaving together those with the aperture to see the effect of scene
scale. Maybe not what you asked about, but it is a relationship of distances and
aperture size.

Posting that here for you so you know what I'm using to check this with. Oh, and
a hint for improving focal blur quality is to use +a (default antialiasing)
along with these type of renders. I realize the documentation says camera blur
doesn't need that but it can help clean it up anyhow.

Most importantly is that I believe you are probably going to find limitations
concerning scene dimensions and camera focus. However, think of it this way... a
real camera lens tends to lose depth of field when everything is a great
distance away. And when things are very close they all but disappear if way out
of the focal plane, just not entirely so there's a ghosting effect from those
close objects.

Anyway I'm fairly sure POV-Ray won't cover every possible combination of
camera+object distances with the same accuracy of actual camera lenses.

I know this subject was discussed again and again over the many years since
focal blur was introduced, unfortunately I failed to find what I was searching
for. I was thinking someone had at some time had attempted to relate POV-Ray to
lens focus long before you asked here recently. Sorry I couldn't.

Bob


Post a reply to this message


Attachments:
Download 'camera focus test.txt.pov.txt' (1 KB)

From: Alain
Subject: Re: Help needed with the focal blur module
Date: 10 Oct 2016 19:11:40
Message: <57fc202c$1@news.povray.org>

> I need a bit of help with the focal blur module. I am trying to render a simple
> scene with 3 vertical bars in the front and 3 horizontal ones at the back. I'm
> having trouble with setting the focal length in the scene (focal_point does not
> seem to work for this). All the scene parameters (for eg. distances of objs from
> camera, their thickness etc.) are in terms of focal length. How do I set it as a
> param and use it to define all other distances? Also generally aperture in
> cameras is defined as a fraction of 'f'. How does the aperture param in POVRay
> correspond to real apertures defined as such?
>
> Another doubt: As I am trying to increase the aperture and putting my
> focal_point on the vertical bars in the front (ref: images in the ZIP), the bars
> at the back start "splitting" into parts. Any thoughts on how this could be
> happening?
>
> Thanks in advance!
>

The breaking up of the bars is caused by the first few samples all 
falling outside of the objects. In this case, POV-Ray "think" that that 
area already got enough samples.
The cure is to use the two parameters form for the number of samples to 
take.

When you use only a single parameter, you only set the MAXIMUM number of 
samples to take, and, in some cases, it leads to what you see in your 
examples.
When you provide two parameters, you explicitly set the minimum number 
of samples to use.
The syntax is :
blur_samples Minimum_Samples, Maximum_Samples

The default minimum number of samples to use is set to 7 if you use more 
than 7 samples, and 4 otherwise. In your case, when using larger 
apertures, it's not enough. Try something larger in the 9 to 20 range. 
Use the smallest value that make the problem go away, as larger values 
will only result in longer rendering times.


Post a reply to this message

From: omniverse
Subject: Re: Help needed with the focal blur module
Date: 11 Oct 2016 13:35:00
Message: <web.57fd21c0315ae166b1933f770@news.povray.org>
Alain <kua### [at] videotronca> wrote:
> blur_samples Minimum_Samples, Maximum_Samples
>
> The default minimum number of samples to use is set to 7 if you use more
> than 7 samples, and 4 otherwise.

I didn't know that. Well I knew about minimum and maximum for media, just
obviously forgotten about for camera blur until you reminded me.
Those are very small numbers for defaults. Trying blur_samples 3, 33 here and
that looks good enough along with default AA (using +a command line).


Post a reply to this message

From: Alain
Subject: Re: Help needed with the focal blur module
Date: 11 Oct 2016 17:03:42
Message: <57fd53ae$1@news.povray.org>

> Alain <kua### [at] videotronca> wrote:
>> blur_samples Minimum_Samples, Maximum_Samples
>>
>> The default minimum number of samples to use is set to 7 if you use more
>> than 7 samples, and 4 otherwise.
>
> I didn't know that. Well I knew about minimum and maximum for media, just
> obviously forgotten about for camera blur until you reminded me.
> Those are very small numbers for defaults. Trying blur_samples 3, 33 here and
> that looks good enough along with default AA (using +a command line).
>

For media, the minimum/maximum mechanism is ONLY for sampling method 1 
and 2 where you have multiple intervals.
Now, with method 3 been the default, only the first value is ever used. 
Any second value is silently ignored. Also, ratio, variance and 
confidence are NOT used anymore as the are used to control how many 
samples are taken in each intervals.

The sampling defaults for media are:
method 3
intervals 1 // MUST stay at that value
samples 10 // must be 3 or larger
jitter on

ratio [NOT applicable as there is ONLY a single interval]
variance [NOT applicable as there is ONLY a single interval]
confidence [NOT applicable as there is ONLY a single interval]

Increasing intervals have horrible effect on the rendering speed. I 
know, I've done my testings.


Alain


Post a reply to this message

From: omniverse
Subject: Re: Help needed with the focal blur module
Date: 11 Oct 2016 22:20:01
Message: <web.57fd9d77315ae166b1933f770@news.povray.org>
Alain <kua### [at] videotronca> wrote:
> For media, the minimum/maximum mechanism is ONLY for sampling method 1
> and 2 where you have multiple intervals.
> Now, with method 3 been the default, only the first value is ever used.
> Any second value is silently ignored. Also, ratio, variance and
> confidence are NOT used

Ahh yes, method 3 default. I'm relearning thanks to you. I sure didn't know it
only accepts a single sampling number, unlike the other two methods. Albeit
optional still.

Definitely know about that pesky intervals thing. Could never bring myself to
use more than 2. Always something to slow down a newer faster computer!

Thanks again, teacher Alain!


Post a reply to this message

From: Alain
Subject: Re: Help needed with the focal blur module
Date: 12 Oct 2016 15:08:39
Message: <57fe8a37$1@news.povray.org>

> Alain <kua### [at] videotronca> wrote:
>> For media, the minimum/maximum mechanism is ONLY for sampling method 1
>> and 2 where you have multiple intervals.
>> Now, with method 3 been the default, only the first value is ever used.
>> Any second value is silently ignored. Also, ratio, variance and
>> confidence are NOT used
>
> Ahh yes, method 3 default. I'm relearning thanks to you. I sure didn't know it
> only accepts a single sampling number, unlike the other two methods. Albeit
> optional still.
>
> Definitely know about that pesky intervals thing. Could never bring myself to
> use more than 2. Always something to slow down a newer faster computer!
>
> Thanks again, teacher Alain!
>
With method 1 and 2, it was often needed to use many intervals. I've 
seen 50 and more in some older scenes.
If a ray where to pass through the beams of, say, 25 non-overlaping 
spotlights, you need at least 50 intervals: one for each beams and 
another for the space between them. This assume that the camera is 
within the first beam or there is something in the last one.

Now, with method 3, you would use 100 samples and get faster and 
probably beter results.


Post a reply to this message

From: udyank
Subject: Re: Help needed with the focal blur module
Date: 17 Oct 2016 04:05:01
Message: <web.5804855b315ae166f2ed086a0@news.povray.org>
Thanks Alain for that, I was able to fix the breaking of bars with the MIN
bound!

Can you help with the other doubt? All my scene parameters (for eg. distances of
objs from camera, their thickness etc.) are in terms of focal length . How do I
know the focal length of POVRay's camera, and set 'f' as a parameter and use it
to define all other scene distances? And how to set camera aperture in terms of
f-number?


Post a reply to this message

Goto Latest 10 Messages Next 3 Messages >>>

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