POV-Ray : Newsgroups : povray.binaries.images : Re: Regarding the defocus module : Re: Regarding the defocus module Server Time
10 May 2024 15:37:20 EDT (-0400)
  Re: Regarding the defocus module  
From: Alain
Date: 13 Sep 2016 12:41:42
Message: <57d82c46$1@news.povray.org>

> Hey!
> @clipka: Thanks for your earlier clarifications. They really helped!
>
> I need a little more help. I am trying out a sample scene with 3 horizontal bars
> in the front and 3 vertical ones at the back. I have an image of this scene I
> want to compare POVRay's result to, but I'm having problems setting up a few
> parameters.
> - First of all, in the picture you attached before (aperture.png) with the
> standard lens diagram, We had an image plane along with the lens an object. My
> understanding was that the camera parameters in POVRay are for the 'lens' part.
> I set the focal length using the 'direction' variable (I hope that's correct).
> So how do I specify where the image plane is to be?

The direction vector set the reference plane of the image. Objects in 
front of that point appear larger and those beyond appear smaller. Along 
with the up and right vectors, it determine the field of view, not a 
focal length.
The image plane is where the point computer by adding the camera's 
location and the direction vector, and is perpendicular to the direction 
vector. It's further modified if you use look_at or any transformation 
on the camera.

> - Also regarding the aperture, the official doc says "while this behaves as a
> real camera does, the values for aperture are purely arbitrary and are not
> related to f-stops." If I want to specify the aperture value as 'f/X' as in a
> camera (ie. with respect to focal length), how can I specify that?

The f/x is a ratio. Say the focal_point is 100 unit in front of the 
camera and you want an f/x of f100, you divide the distance between the 
camera and focal_point by your f/x, in this case, it gives an aperture of 1.
Formula:
vlength(Camera_Location - focal_point)/ (f/x)

> - Regarding the confidence value: the doc says "The confidence value is used to
> determine when the samples seem to be close enough to the correct color." How
> does POVRay 'know' the correct color? Suppose I have a point (like P in the
> image) I'm shooting a number of rays from, which are slightly deviated from each
> other going to the lens, and converging at 1 pt P' on the other side. Suppose
> some hit an object before P' and some hit it after, but hit different objects.
> So how do you know the correct color in such a case, and subsequently, when to
> stop tracing more samples as the color is 'close enough'?

confidence is the probability that the resulting colour is correct. 
It's a statistical thing. It's recommended to always use a value smaller 
than 1.
variance is how much you are willing to deviate from the exact colour. 
Using a value of zero is not recommended. Instead, use a very small 
value like 1e-6 or smaller.
After each samples are taken, they are averaged and compared with the 
average of the previous samples. If the change after adding a new sample 
is small enough, you can say that you are close enough. That evaluation 
also depends on variance and adc_bailout from the global_settings.

> - Finally, I have a different setup where I've configured my rays to just pick
> up the color value of the object the ray hits and add it up on the target pixel
> the ray comes from. Is there a way to bypass the color calculations (the
> diffuse/ambient/specular etc. values) and just make POVRay add up the color
> value to the pixel where it's color is to be added?

Remove all light.
Set all finish as :
finish{ambient 1 diffuse 0 reflection 0 specular 0 phong 0}
Alternatively, but without focal blur, use +q0 on the command line.

>
> I'm attaching the files I'm using in the setup, along with the 'aperture.png'
> used for reference. The testing1.png is when i'm using the 'focal_point'
> parameter, and testing2.png is when that is removed. Why is such an effect
> happening? Because from my understanding, f-value=1 unit (As set by
> 'direction').
> Thanks in advance!
>
You need to set focal_point.
If left undefined, it may get located at the same place as the camera, 
or extremely far away.

A warning: You must use look_at AFTER you set the direction vector.
Normally, it's the last item when using a standard camera, and you only 
set the focal blur parameters after it.
Good : direction <0,0,0>  look_at   <0.0, 1.0,  0.0>
Bad :  look_at  <0.0, 1.0,  0.0>   direction <0,0,0>


Post a reply to this message

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