|
Post by sbphillips on Feb 3, 2022 23:05:52 GMT
Can anyone provide more guidance on implementing focal blur. I've read it a few times but am not getting it. I need to input aperture and focal length but I'm not sure what the units are. I don't have a know test case to work with.
2/6/2022 I think I need more help regarding the relationship between the camera transformation and focal length. Do I pick a point of interest in the scene and compute the distance to the camera to determine the focal length
|
|
|
Post by Jamis on Feb 7, 2022 15:36:44 GMT
sbphillips -- good questions. Aperture radius uses a pixel as the unit. Without focal blur, you are casting a single ray for each pixel, from the origin, through the canvas, and into the scene. With focal blur, you're going to jitter that origin point by some amount, which will change the direction of the ray. To get the blur, you'll cast multiple rays (samples) into the scene at each pixel, each one jittered by some random amount. That random amount is the aperture size, and you typically don't want it to be more than a single pixel. Focal length is measured in world space units. As implemented in the book, your default focal length is 1 -- the distance from the camera origin to the canvas. By changing that focal length you can change which objects are in focus when using a non-zero aperture size. You'll use the focal length when computing the canvas metrics. Specifically, the "half width" value, which is computed as "tan(fov / 2)", will now become "focal_length * tan(fov / 2)". Does that clear it up at all?
|
|