Deriving blur from real optical formulae Looking at the Wikipedia page for Circle of Confusion, and at such posts as this one, I completely understand how to calculate the values for near, far, focal planes and hyperfocal distance. I am also aware of the Zeiss formula for my desired format.

What I'm trying to find out is how to take real camera parameters (focal distance, aperture, focal length) and get a blur radius or similar usable value to configure a blur with them.

Currently, I'm simply using this function:

float getBlurSize(float depth, float focusPoint, float focusScale) {
    float coc = clamp((1.0 / focusPoint - 1.0 / depth)*focusScale, -1.0, 1.0);
    return abs(coc) * MAX_BLUR_SIZE;
}


All real-world inputs are available to the shader - Aperture f-Number, focal distance, format dimensions (35mm in this case), maximum acceptable CoC from the Zeiss formula, focal length etc., as well as depth and colour. Currently, I am applying the calculations and blur in post.
First we can calculate the physical diameter of CoC in the image plane, given the lens parameters. This equation is from Wikipedia – Circle of confusion:
$$
c = {|S_2 - S_1| \over S_2} {f^2 \over N(S_1 - f)}
$$
where the variables are:


$c$: the physical CoC diameter in the image plane
$S_1$: focal distance (the distance at which a subject would be in perfect focus)
$S_2$: actual distance to the subject (the point whose CoC we are calculating)
$f$: the focal length of the lens
$N$: the f-number at which the lens aperture is set.


Then, divide this CoC diameter by the film or sensor frame size to get the blur diameter in texture coordinates. You can additionally multiply it by your rendering resolution to get the blur diameter in pixels if desired.

As an example calculation, suppose we render a 1920×1080 image, as if through a 85mm lens at f/1.4, on a 35mm camera (frame size 36×24 mm), and focused at 3m while our subject is 5m away. Then we can calculate:
$$
{|5\text{m} - 3\text{m}| \over 5\text{m}} {(85\text{mm})^2 \over 1.4(3\text{m} - 85\text{mm})} {1920\text{px} \over 36\text{mm}}
$$
(Don't forget to convert units, since we are mixing meters and millimeters here!) I get a blur diameter of ~38 px, so the radius would therefore be ~19 px.