POV-Ray : Newsgroups : povray.advanced-users : Camera scaling and focal_blur? Server Time
27 Apr 2024 05:11:27 EDT (-0400)
  Camera scaling and focal_blur? (Message 9 to 18 of 28)  
<<< Previous 8 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Kenneth
Subject: Re: Camera scaling and focal_blur?
Date: 11 Feb 2018 22:40:00
Message: <web.5a810c7d3abb6b9ea47873e10@news.povray.org>
Mike Horvath <mik### [at] gmailcom> wrote:
> I still don't understand exactly what's happening, but I removed the
> scaling and just increased the numbers directly, and things are working
> out much better.

I've never tried *scaling* a camera before, but it's an interesting idea.

Using your 'scale 2' camera, what it looks like is that the focal_blur's
focal_point of <0,0,0> (the focal 'plane')is actually shifting to <0,0,-5>. In
other words, it's keeping the same original 5-unit distance from the CAMERA--
not scaling to 2*5 = 10-units. That's what I see from a simple test, anyway.


Post a reply to this message

From: Mike Horvath
Subject: Re: Camera scaling and focal_blur?
Date: 11 Feb 2018 22:46:22
Message: <5a810e0e@news.povray.org>
On 2/11/2018 10:39 PM, Kenneth wrote:
> Mike Horvath <mik### [at] gmailcom> wrote:
>> I still don't understand exactly what's happening, but I removed the
>> scaling and just increased the numbers directly, and things are working
>> out much better.
> 
> I've never tried *scaling* a camera before, but it's an interesting idea.
> 
> Using your 'scale 2' camera, what it looks like is that the focal_blur's
> focal_point of <0,0,0> (the focal 'plane')is actually shifting to <0,0,-5>. In
> other words, it's keeping the same original 5-unit distance from the CAMERA--
> not scaling to 2*5 = 10-units. That's what I see from a simple test, anyway.
> 
> 
> 
> 

I posted my scene in p.t.s-f. Could you take a look at that?

Thanks.


Mike


Post a reply to this message

From: Kenneth
Subject: Re: Camera scaling and focal_blur?
Date: 11 Feb 2018 23:15:00
Message: <web.5a8113d93abb6b9ea47873e10@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:

>
> Using your 'scale 2' camera, what it looks like is that the focal_blur's
> focal_point of <0,0,0> (the focal 'plane')is actually shifting to <0,0,-5>. In
> other words, it's keeping the same original 5-unit distance from the CAMERA--
> not scaling to 2*5 = 10-units. That's what I see from a simple test, anyway.

.... and changing the focal_point to <0,0,5> does indeed bring the focal plane
back to the original <0,0,0>.

Although, for a camera position that's not just <0,0,0> but something like
<3,13,-9>, it appears that the interplay between scaled camera and 'new' focal
plane gets much more complicated.

But I tried something weird, which seems to work(!) ...

The initial simple test:
original camera position: <0,0,-5>
original focal_point: <0,0,0>

With scale 2:
new camera position: <0,0,-10>
new focal_point set to: <0,0,5>

Now, with a more complicated camera position:
original camera position: <3,13,-9>
original focal point: <0,0,0>

With scale 2:
new camera position: <...? ...> (I'm too lazy to figure it out)
new focal_point set to: <-13,-3,9>

That appears to bring the original 'focal plane' of <0,0,0> back into sharp
focus! (Although, that plane is always perpendicular or orthogonal(?) to the
camera view.) The math for the new focal_point looks to be quite simple as well.


Post a reply to this message

From: Mike Horvath
Subject: Re: Camera scaling and focal_blur?
Date: 12 Feb 2018 01:06:07
Message: <5a812ecf$1@news.povray.org>
On 2/11/2018 11:11 PM, Kenneth wrote:
> "Kenneth" <kdw### [at] gmailcom> wrote:
> 
>>
>> Using your 'scale 2' camera, what it looks like is that the focal_blur's
>> focal_point of <0,0,0> (the focal 'plane')is actually shifting to <0,0,-5>. In
>> other words, it's keeping the same original 5-unit distance from the CAMERA--
>> not scaling to 2*5 = 10-units. That's what I see from a simple test, anyway.
> 
> .... and changing the focal_point to <0,0,5> does indeed bring the focal plane
> back to the original <0,0,0>.
> 
> Although, for a camera position that's not just <0,0,0> but something like
> <3,13,-9>, it appears that the interplay between scaled camera and 'new' focal
> plane gets much more complicated.
> 
> But I tried something weird, which seems to work(!) ...
> 
> The initial simple test:
> original camera position: <0,0,-5>
> original focal_point: <0,0,0>
> 
> With scale 2:
> new camera position: <0,0,-10>
> new focal_point set to: <0,0,5>
> 
> Now, with a more complicated camera position:
> original camera position: <3,13,-9>
> original focal point: <0,0,0>
> 
> With scale 2:
> new camera position: <...? ...> (I'm too lazy to figure it out)
> new focal_point set to: <-13,-3,9>
> 
> That appears to bring the original 'focal plane' of <0,0,0> back into sharp
> focus! (Although, that plane is always perpendicular or orthogonal(?) to the
> camera view.) The math for the new focal_point looks to be quite simple as well.
> 
> 
> 
> 
> 
> 

Thanks! That means:

     #local NewCameraFocalPoint = -1 * OldCameraLocation * 
(NewCameraScale - 1);

But is this only true if the OldCameraFocalPoint is <0,0,0>? What 
happens when the OldCameraFocalPoint is <5,20,-1>?

Would it be more intuitive if the focal point location automatically 
scaled scaled with the camera position? E.g.

     #local NewCameraFocalPoint = OldCameraFocalPoint * NewCameraScale;


Mike


Post a reply to this message

From: Kenneth
Subject: Re: Camera scaling and focal_blur?
Date: 12 Feb 2018 08:10:01
Message: <web.5a818fe93abb6b9ea47873e10@news.povray.org>
Mike Horvath <mik### [at] gmailcom> wrote:

> Thanks! That means:
>
>      #local NewCameraFocalPoint = -1 * OldCameraLocation *
> (NewCameraScale - 1);
>
> But is this only true if the OldCameraFocalPoint is <0,0,0>? What
> happens when the OldCameraFocalPoint is <5,20,-1>?

Off the top of my head, I would imagine that it's just a matter of adding or
subtracting the correct differences in values, kind of like my scale 2 example.
I haven't tested that idea though. (I'm also not totally sure if your equation
can work with an odd scaling factor of, say, 4.7 rather than 2 or 3 or 4. Maybe
it can!)

BTW: Having three active newsgroup threads, all generally about the same topic,
is kind of confusing; I'm not sure where to post follow-ups now. In future, it
would be best to have only one (or maybe an extra one for posting actual code,
if it happens to be quite long), and let the comments roll in. ;-)


Post a reply to this message

From: Bald Eagle
Subject: Re: Camera scaling and focal_blur?
Date: 12 Feb 2018 08:35:00
Message: <web.5a8197ef3abb6b9ec437ac910@news.povray.org>
I think you need to look at it from the perspective of points, or vectors and
how they behave when scaled.

You have your camera position at a non-origin position, and then you scale it.
So it MOVES.
I'd say the same goes with the look_at point.

Try using a vector transform on a "point" and see if the scaling transform on
two vectors defined to be your camera position and look_at points give you
results that make sense.

#declare MyTransform = transform { scale { ... } }
#declare Foo2 = vtransform(Foo1,MyTransform);

from:
http://news.povray.org/povray.newusers/thread/%3Cweb.56d370be14d864ee5e7df57c0%40news.povray.org%3E/?ttop=418731&toff=5
0


Post a reply to this message

From: Mike Horvath
Subject: Re: Camera scaling and focal_blur?
Date: 12 Feb 2018 10:22:02
Message: <5a81b11a$1@news.povray.org>
On 2/12/2018 8:34 AM, Bald Eagle wrote:
> I think you need to look at it from the perspective of points, or vectors and
> how they behave when scaled.
> 
> You have your camera position at a non-origin position, and then you scale it.
> So it MOVES.
> I'd say the same goes with the look_at point.
> 
> Try using a vector transform on a "point" and see if the scaling transform on
> two vectors defined to be your camera position and look_at points give you
> results that make sense.
> 
> #declare MyTransform = transform { scale { ... } }
> #declare Foo2 = vtransform(Foo1,MyTransform);
> 
> from:
>
http://news.povray.org/povray.newusers/thread/%3Cweb.56d370be14d864ee5e7df57c0%40news.povray.org%3E/?ttop=418731&toff=5
> 0
> 
> 


Yes, look at the code I posted in p.t.s-f. That's why I posted it.


Mike


Post a reply to this message

From: Alain
Subject: Re: Camera scaling and focal_blur?
Date: 12 Feb 2018 14:00:02
Message: <5a81e432@news.povray.org>
Le 18-02-10 à 19:47, Mike Horvath a écrit :
> What effect does scaling a camera have on focal_blur?
> 
> I have two cameras, and they should both produce the same result. But 
> they don't.
> 
> 
> 
> // focal blur camera
> camera {
>    location  <0,0,-5>
>    look_at   <0,0,0>
>    right     x*image_width/image_height
>    up y
>    aperture 1.0           // [0...N] larger is narrower depth of field 
> (blurrier)
>    blur_samples 10        // number of rays per pixel for sampling
>    focal_point <0,0,0>    // point that is in focus <X,Y,Z>
>    confidence 0.95        // [0...<1] when to move on while sampling 
> (smaller is less accurate)
>    variance 1/200         // [0...1] how precise to calculate (smaller 
> is more accurate)
>    scale 2
> }
> 
> /*
> // focal blur camera
> camera {
>    location  <0,0,-10>
>    look_at   <0,0,0>
>    right     x*image_width/image_height
>    up y
>    aperture 1.0           // [0...N] larger is narrower depth of field 
> (blurrier)
>    blur_samples 10        // number of rays per pixel for sampling
>    focal_point <0,0,0>    // point that is in focus <X,Y,Z>
>    confidence 0.95        // [0...<1] when to move on while sampling 
> (smaller is less accurate)
>    variance 1/200         // [0...1] how precise to calculate (smaller 
> is more accurate)
> }
> */

The amount of focal blur depends on the ratio between (1) the distance 
between the camera's location and the focal point location and (2) the 
actual aperture.

So, with everything else been the same, the second camera have twice the 
focal length for the same aperture, resulting in half the focal blur or 
twice the sharpness depth.

To get the same results, you need to scale the aperture by the same 
amount as the rest of the camera use for the second camera :
aperture 2.0


Alain


Post a reply to this message

From: Alain
Subject: Re: Camera scaling and focal_blur?
Date: 12 Feb 2018 14:02:09
Message: <5a81e4b1$1@news.povray.org>
Le 18-02-10 à 22:36, Mike Horvath a écrit :
> I've been reading this
> 
> https://en.wikipedia.org/wiki/Miniature_faking
> 
> and have been wondering how to achieve the effect in POV-Ray. Obviously, 
> there is no true scale in POV-Ray, so there's no need to "fake" the 
> effect. But I don't know how to construct the correct camera.
> 
> Any ideas?
> 
> 
> Mike

Use a larger aperture. Something like
vlength(Camera_Location, Focal_point)/4

If that's not enough, use a smaller divisor.


Post a reply to this message

From: Mike Horvath
Subject: Re: Camera scaling and focal_blur?
Date: 12 Feb 2018 16:01:53
Message: <5a8200c1$1@news.povray.org>
On 2/12/2018 2:00 PM, Alain wrote:
> Le 18-02-10 à 19:47, Mike Horvath a écrit :
>> What effect does scaling a camera have on focal_blur?
>>
>> I have two cameras, and they should both produce the same result. But 
>> they don't.
>>
>>
>>
>> // focal blur camera
>> camera {
>>    location  <0,0,-5>
>>    look_at   <0,0,0>
>>    right     x*image_width/image_height
>>    up y
>>    aperture 1.0           // [0...N] larger is narrower depth of field 
>> (blurrier)
>>    blur_samples 10        // number of rays per pixel for sampling
>>    focal_point <0,0,0>    // point that is in focus <X,Y,Z>
>>    confidence 0.95        // [0...<1] when to move on while sampling 
>> (smaller is less accurate)
>>    variance 1/200         // [0...1] how precise to calculate (smaller 
>> is more accurate)
>>    scale 2
>> }
>>
>> /*
>> // focal blur camera
>> camera {
>>    location  <0,0,-10>
>>    look_at   <0,0,0>
>>    right     x*image_width/image_height
>>    up y
>>    aperture 1.0           // [0...N] larger is narrower depth of field 
>> (blurrier)
>>    blur_samples 10        // number of rays per pixel for sampling
>>    focal_point <0,0,0>    // point that is in focus <X,Y,Z>
>>    confidence 0.95        // [0...<1] when to move on while sampling 
>> (smaller is less accurate)
>>    variance 1/200         // [0...1] how precise to calculate (smaller 
>> is more accurate)
>> }
>> */
> 
> The amount of focal blur depends on the ratio between (1) the distance 
> between the camera's location and the focal point location and (2) the 
> actual aperture.
> 
> So, with everything else been the same, the second camera have twice the 
> focal length for the same aperture, resulting in half the focal blur or 
> twice the sharpness depth.
> 
> To get the same results, you need to scale the aperture by the same 
> amount as the rest of the camera use for the second camera :
> aperture 2.0
> 
> 
> Alain

You're wrong, and Kenneth already figured out why up-thread.


Mike


Post a reply to this message

<<< Previous 8 Messages Goto Latest 10 Messages Next 10 Messages >>>

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