POV-Ray : Newsgroups : povray.binaries.images : Help needed with the focal blur module Server Time
2 May 2024 18:59:02 EDT (-0400)
  Help needed with the focal blur module (Message 4 to 13 of 13)  
<<< Previous 3 Messages Goto Initial 10 Messages
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

From: Alain
Subject: Re: Help needed with the focal blur module
Date: 17 Oct 2016 19:24:04
Message: <58055d94@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?
>
>

I can't give you a definite answer, but, here's my interpretation :

The "f" parameter could be seen as the ratio between the length of the 
direction vector and the apperture value. It don't mather if that plane 
is in front or beheind the camera's location, just the absolute values 
count.

The focal length could be seen as the length of the direction vector.

The location of the camera is the optical center of the virtual lense. 
(as mentioned by clipca)


Post a reply to this message

From: udyank
Subject: Re: Help needed with the focal blur module
Date: 18 Oct 2016 00:45:01
Message: <web.5805a838315ae166f2ed086a0@news.povray.org>
> I can't give you a definite answer, but, here's my interpretation :
> The "f" parameter could be seen as the ratio between the length of the
> direction vector and the apperture value. It don't mather if that plane
> is in front or beheind the camera's location, just the absolute values
> count.
> The focal length could be seen as the length of the direction vector.

Thanks for that! I'll try it out and see if these work. Might need some
experimenting. Although I have to ask: why isn't there a definite answer to this
question? Is this something that POVRay doesn't want to simulate as such?
Because they (focal length, aperture) seem to be pretty standard things a person
would want to set in their scene setups when they place their camera, and be
able to easily control them to see changes/effects etc. in their outputs.


Post a reply to this message

From: clipka
Subject: Re: Help needed with the focal blur module
Date: 18 Oct 2016 03:22:34
Message: <5805cdba@news.povray.org>
Am 18.10.2016 um 06:42 schrieb udyank:

> Thanks for that! I'll try it out and see if these work. Might need some
> experimenting. Although I have to ask: why isn't there a definite answer to this
> question? Is this something that POVRay doesn't want to simulate as such?
> Because they (focal length, aperture) seem to be pretty standard things a person
> would want to set in their scene setups when they place their camera, and be
> able to easily control them to see changes/effects etc. in their outputs.

POV-Ray has its origins in the early world of computer graphics
enthusiasts, not the media world. That's why its camera syntax has been
strongly influenced by the inner workings of 3D rendering, rather than
camera technology.

The simple fact is that since then nobody has added an alternative, more
camera technology-oriented syntax -- yet.

The POV-Ray developers' tradition to favour extension by macros rather
than by hard-coded features probably plays a role in this as well.


Post a reply to this message

<<< Previous 3 Messages Goto Initial 10 Messages

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