Amerio.Stephane Posted September 24 Posted September 24 Hello, The DOF documentation is unclear to me (and maybe misleading). https://developer.unigine.com/en/docs/latest/editor2/settings/render_settings/camera_effects/?highlighted=dof,doflll#dof From my own experiment, this is the actual behavior of the DOF effects (and I'm quite pleased with it) From what I've seen, NearDistance is measured from the Focal Distance - Near Focal Offset, while the documentation says it's measured from the camera. Conversely, Far Distance is measured from Focal Distance + Far Focal Offset, while the doc says it's from the camera. The effect itself works great as-is, it's just that the doc is not accurate, and a diagram such as the one I post here would be very helpful in the doc. In the event the doc is actually correct, then either the implementation is wrong or I totally misunderstood how to use it and interpret it 🙂
silent Posted September 24 Posted September 24 Hi Stephane, Thank you for the detailed report and the diagram. You are absolutely right: your understanding matches the actual implementation, and the documentation is inaccurate here. This is how the zones are laid out (all positions are distances from the camera): Perfect focus: from Focal Distance − Near Focal Offset to Focal Distance + Far Focal Offset Far gradient: starts at Focal Distance + Far Focal Offset and reaches full blur at Focal Distance + Far Focal Offset + Far Distance Near gradient: starts at Focal Distance − Near Focal Offset and reaches full blur at Focal Distance − Near Focal Offset − Near Distance So Near Distance and Far Distance are not measured from the camera. They set the length of the transition (gradient) zone, measured outward from the edges of the in-focus zone. That is exactly what your diagram shows. We will correct the parameter descriptions in the documentation and the Editor tooltips, and add a diagram similar to yours. With your permission, we would like to use your diagram as a basis for it. Thanks again for pointing this out! 1 How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Amerio.Stephane Posted September 25 Author Posted September 25 Thanks for confirming my understanding, and that would be a great diagram. As a suggestion for future versions, would it be possible to support a physical definition of the DOF? Instead of giving artistic driven parameters (near distance, offset, etc), physicial parameters such as sensor size + aperture + focus distance would be a great alternative. It would allow us to try to match more precisely what an actual camera can reliably get in focus especially on very long zoom. (nice to have, absolutely not a critical feature). Thanks!
silent Posted September 25 Posted September 25 Hi Stephane, The thing is that simulating physical correct DOF is quite performance demanding operation. But I hope that someday it would be possible to simply switch to the physically based implementation with a couple of clicks 🙂 Thank you! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Amerio.Stephane Posted September 25 Author Posted September 25 Oh of course, I'm not expecting a real DOF simulation (way too costly), but more of a simple integration of a DOF calculator like this one (allowing everyone to use it directly instead of relying on a custom Component). https://1000freetools.com/calculators/aperture-depth-of-field-calculator Similarly to the camera exposure having both a Classic and Physically Based settings, there could be the same for the DOF (with the simple approximation given by a DOF calculator) 1
Recommended Posts