Hi all !
I'm currently trying some various graphics techniques and I have some questions regarding the depth of field and more specially about computing the COC...
I use this computation for the COC : A * (F*(P-D)) / (D*(P-F)) where A = aperture diameter, F = Focal length, P = Focus Plane and D = object distance. (Note that I saw some paper using D-P instead of P-D in the first part, not sure which one is the good one ...)
A, F and P come from the camera settings and D is the taken from the depth buffer but I'm having problems with the computed size ... If my engine unit is 1 = 1m I need to convert the other parameters to the same unit correct ? (that means aperture size from mm to m, same for F and P)
Also using the 1st equation should give me the same result as using the CoCScale & Bias when using the raw z right ?