Is there a better way to set fStop than experimenting?
Greetings, Poser users!
In Superfly, the camera value for fStop seems to be the only factor determining the depth of field around the action point (or plane) of focus. Unfortunately, I have not found a better way to set this value than to experiment with various values. Some 3D engines allow for the creation of cameras in which one can, for example, set the focus point at distances 80 to 100 (which is, to my understanding, entirely unrealistic - but works well enough), but this doesn't seem to be the case in Poser.
I am, for example, trying to get a sitting person in focus. I want the face to be spot-on, but I want the feet to be sharp as well - but increasing the fStop to achieve this also creates a huge in-focus area behind the character, and that's not necessarily ideal.
Are there ways to get a better sense of the drop-off in focus in Poser? Something like a guide similar to the focus distance that might shed some light on how the fStop value reduces or expands the depth of field?
@adosity here are some Python fragments which deal with the standard camera depth of field, hyperfocus and fStop formulas:
CircleOfConfusion = 0.03 # mm def HyperFocal(f, N, c): """ # f = focal length in millimetres # N = fStop # c = circle of confusion in millimetres # returned units are millimetres """ return f + ( ( f * f ) / ( N * c ) ) def FStop(f, s, c): """ # f = focal length in millimetres # s = focus distance in millimetres # c = circle of confusion in millimetres # returned value is a scalar (unitless) representing the maximum DOF when focus distance = hyperfocus """ return ( f * f ) / ( ( s - f ) * c ) def NearFocus(f, N, c, s): """ # f = focal length in millimetres # N = fStop # c = circle of confusion in millimetres # s = focus distance in millimetres # returned units are millimetres """ H = HyperFocal(f, N, c) return s * ( H - f ) / ( H + s - ( 2 * f ) ) def FarFocus(f, N, c, s): """ # f = focal length in millimetres # N = fStop # c = circle of confusion in millimetres # s = focus distance in millimetres # returned units are millimetres """ H = HyperFocal(f, N, c) return s * ( H - f ) / ( H - s )
Ran out of time to edit... continuing.
If you set your camera's hither to NearFocus(), and yon to FarFocus(), you can tell what parts of the scene will be in sharp focus (provided Depth Of Field is enabled in your selected render engine).
To achieve maximum depth of field for a given focus distance (which occurs when the HyperFocus matches that focus distance), set the camera's focus distance to the part of the scene you want to be in sharpest focus (typically a character's face or torso, if framing a complete figure) then plug that into the FStop formula to get the best fStop (don't be suprised if the values are huge for closeup scenes) then plug that into the NearFocus and FarFocus formulas for hither and yon.
Not being a photographer, I find myself wanting to view scenes as though I was a human physically present, so I rarely use focal lengths greater than about 50mm. If I want a panorama or fish-eye effect, I'll typically drop that focal length to 12.5mm. The dark adapted human eye (pupil fully dilated) has an fStop of about 8.3, IIRC.
@adosity - I use the same rough guide as 35mm photography (& it is rough, Poser is not the same but it's close enough for me). The smaller the fStop the shallower the DoF & vice versa. The focal length can have a big effect on perceived DoF as the larger the focal length the greater the magnification so the more pronounced the effect becomes - Cambridge in Colour explains this properly.
In your example, a seated figure where you want the figure sharp but the background blurred, I'd try a focal length somewhere between 75 - 135mm. I'd get the shot framed first, then set the focus distance (dolly the camera in y or x but not z to make it easier to line up the guide as needed). I'd use a small render size & low samples for speed, then start with an fStop of 4, then 2, then 1. Experimenting by making lots of small fast renders (with reference to photographic examples) is IMHO the easiest way to get a feel for this.
@anomalaus Thanks for your response. I'm not sure about the Python-part (I'm assuming this quoted part is a section of a larger, not necessarily Poser-related, script). I've set the formulas up in Excel and did some tests. The way I understand your post is as follows:
- For maximum depth of field, use the formula 'define fStop' with values from the Poser camera. I'm not entirely sure how this would be different from simply disabling depth of field in the render settings, though.
- For any other situation, the depth of field resulting from specific camera settings can be shown in Poser by using the three other formulas in combination. The NearFocus value used in the hither field of the Poser camera will then hide (in Poser) all the areas that fall out of the depth of field, as will the FarFocus value used in the yon field of the Poser camera - with the first hiding said area in between the camera and the point of focus, and the second hiding said area lying beyond the point of focus. This limits the view within Poser to the area that falls within the depth of field area - more or less. When it comes time to render, those values should be reset as needed by the scene itself.
That seems to work quite well. From doing a couple of tests I find the FarFocus value in particular seems a bit generous (the render loses focus a bit earlier than the value used as hither would suggest prior to rendering) but perhaps a better test scene and a better render will reveal that to be more accurate than it now seems, too. Thank you very much!
@caisson Thanks for your response. That's pretty much how I've done it in Poser, borrowing as you said from real photography. After all, these days it's easy enough to do a few test shots with various fStop levels to narrow in on a workable value. What makes that a bit more tricky in Poser is that using quick renders with low pixel samples can somewhat hide the gradual loss of focus in a mess of grainy pixels!
Thanks for the link, too. It's good to be reminded of the concepts behind these things from time to time. The changing distribution of the DoF in particular is one of those things that takes a while to get used to.
@adosity with real cameras, maximum depth of field occurs when everything from the near focus (hither), through the hyper focus (focus distance) to the far focus (yon, which will be effectively infinity) is effectively in focus. Objects nearer than the near focus will still be out of focus, unlike turning depth of field off, where everything will be in focus, regardless of the hither, yon and fstop settings..
When depth of field is activated, the fStop becomes important, otherwise it can be ignored. The HyperFocus formula is not really equivalent to any of Poser's own camera dials (except when it's calculated value is also plugged into the focus distance for maximum depth of field), but is required to calculate the near and far focus distances.
The Python methods are extracted from a library of useful routines I created to support common functions required by my other poser scripts. Putting them in a library means that any corrections or improvements immediately propagate to all the other scripts which depend on those functions.
Here is a site which I use for my DOF calculation. Highly recommended .
@Ladonna What a great resource Ladonna. Thank you!! I had a link to a DOF Calculator, but it doesn't have the visuals of this site you linked to. Very nice find indeed.