DAZ: DOF for Dummies

For years (really!) I used an incredibly stupid technique to set the Depth Of Field (DOF). In most cases, it was more by chance that the images turned out reasonably well ...
So the title of this thread is primarily aimed at one person: myself
Depth of field is a great thing: with good settings you can achieve more reality for your scene, with more exaggerated settings you can achieve a miniature wonderland effect ... and with a little fiddling you can even achieve a kind of soft focus. DOF is definitely worth trying out - and with the right technique, it's even easy and fun.
DOF in a nutshell: In real life, objects in the background are blurred while objects in the foreground (on which the eyes are focused) are sharper. The effect of blurred backgrounds is also known from macro photography - even if there is only a very (!) short distance between the photographed object and the background. Both can be simulated with DOF.
Let's go ....
First you need a scene with a model, a camera and an environment or a backdrop. If you are in a hurry, you can also duplicate the model and position it approx. 10 ft behind the first model instead of loading an environment. Switch the viewport to the camera view and point the camera at the model.
Select the camera in the SCENE pane, switch to the CAMERAS pane and expand the CAMERA options. Toggle the Depth of field option from OFF to ON.
At this point I should actually describe the incredible nonsense I did not so long ago to get to grips with depth of field. But I'd rather spare you (and myself) that ... You don't have to think I'm any stupider than I am
While the camera is selected in the SCENE pane and the CAMERAS -> Camera options are open, switch the viewport to "Perspective View". You should now see a box surrounding your model (even in Texture Shaded mode). The box moves when you change the FOCAL DISTANCE option in CAMERAS -> Camera settings and shrinks or expands when you use the F/STOP value. Try changing the values until your model (but not more) is inside the box.
Now switch the viewport to "Camera View" and the display mode to "Nvidia Iray". Done! If you are not yet completely convinced, you can try carefully reducing the F/Stop value of the Camara options.
In short: Focal Distance and F/Stop
Focal Distance: as you have just seen when setting up the DOF, this value determines the distance between the camera and the object.
F/Stop: this option is not necessarily self-explanatory (unless you are a photographer or have worked with analog cameras before). This refers to the aperture of the camera and the following applies: a small aperture blurs the background, a large aperture provides more depth of field. That's it.
Have fun ... and enjoy experimenting
So the title of this thread is primarily aimed at one person: myself

Depth of field is a great thing: with good settings you can achieve more reality for your scene, with more exaggerated settings you can achieve a miniature wonderland effect ... and with a little fiddling you can even achieve a kind of soft focus. DOF is definitely worth trying out - and with the right technique, it's even easy and fun.
DOF in a nutshell: In real life, objects in the background are blurred while objects in the foreground (on which the eyes are focused) are sharper. The effect of blurred backgrounds is also known from macro photography - even if there is only a very (!) short distance between the photographed object and the background. Both can be simulated with DOF.
Let's go ....
First you need a scene with a model, a camera and an environment or a backdrop. If you are in a hurry, you can also duplicate the model and position it approx. 10 ft behind the first model instead of loading an environment. Switch the viewport to the camera view and point the camera at the model.
Select the camera in the SCENE pane, switch to the CAMERAS pane and expand the CAMERA options. Toggle the Depth of field option from OFF to ON.
At this point I should actually describe the incredible nonsense I did not so long ago to get to grips with depth of field. But I'd rather spare you (and myself) that ... You don't have to think I'm any stupider than I am

While the camera is selected in the SCENE pane and the CAMERAS -> Camera options are open, switch the viewport to "Perspective View". You should now see a box surrounding your model (even in Texture Shaded mode). The box moves when you change the FOCAL DISTANCE option in CAMERAS -> Camera settings and shrinks or expands when you use the F/STOP value. Try changing the values until your model (but not more) is inside the box.
Now switch the viewport to "Camera View" and the display mode to "Nvidia Iray". Done! If you are not yet completely convinced, you can try carefully reducing the F/Stop value of the Camara options.
In short: Focal Distance and F/Stop
Focal Distance: as you have just seen when setting up the DOF, this value determines the distance between the camera and the object.
F/Stop: this option is not necessarily self-explanatory (unless you are a photographer or have worked with analog cameras before). This refers to the aperture of the camera and the following applies: a small aperture blurs the background, a large aperture provides more depth of field. That's it.
Have fun ... and enjoy experimenting

! REPORT
Wish I would have been smart enough to do a search for something like this when I started trying to figure out how DOF worked in Daz years ago but I'm to thick headed for that! 
Another way I stumbled upon (again, thick headed) which I use when I have a hard time getting a line of sight using the perspective camera is too..
select scene camera, select camera, DOF on, go to display, look for the Near DOF Visibility Plane and Far Dof Visibility Plane settings which have an on/off setting. You should also see a DOF Overlay slider. I crank it up to 100%. Now, with texture shaded turned on in your viewport and main camera selected, toggle one of the Dof visibility planes on and you should see a white plane appear. Near Dof plane is controlled by the f/stop slider in the camera setting and the Far Dof plane is controlled by the focal distance slider. Overall, its the same principle as the method you described but from the main cameras perspective.
Best thing to do is figure out the basics and experiment! I would personally recommend a foreground object also when experimenting, if for no other reason than seeing the foreground blurring effect.
Great post! Hope it helps the non thick headed down the line!


Another way I stumbled upon (again, thick headed) which I use when I have a hard time getting a line of sight using the perspective camera is too..
select scene camera, select camera, DOF on, go to display, look for the Near DOF Visibility Plane and Far Dof Visibility Plane settings which have an on/off setting. You should also see a DOF Overlay slider. I crank it up to 100%. Now, with texture shaded turned on in your viewport and main camera selected, toggle one of the Dof visibility planes on and you should see a white plane appear. Near Dof plane is controlled by the f/stop slider in the camera setting and the Far Dof plane is controlled by the focal distance slider. Overall, its the same principle as the method you described but from the main cameras perspective.
Best thing to do is figure out the basics and experiment! I would personally recommend a foreground object also when experimenting, if for no other reason than seeing the foreground blurring effect.
Great post! Hope it helps the non thick headed down the line!


REPLY
! REPORT
Pushee-Ri
Karma: 36,837
Thu, Nov 14, 2024Thanks so much - especially for the additional information 
Thinking of all the time I've spent with my stupid DOF approach, I hope I can save time (and nerves) for others

Thinking of all the time I've spent with my stupid DOF approach, I hope I can save time (and nerves) for others
dirtrider00
Karma: 16,551
Thu, Nov 14, 2024Ah man, I want to ask so badly how you were doing DOF before but am scared to at the same time. 
Hope my explanation was understandable! My renders are pretty basic but learning DOF and how to use the IRay section plane has really helped me with the small/tight indoor scenes.

Hope my explanation was understandable! My renders are pretty basic but learning DOF and how to use the IRay section plane has really helped me with the small/tight indoor scenes.
I can break it down even simpler. Not that photography terms are "simple". With the DoF plane displays turned on in your camera settings, they should show up in the scene whenever the camera itself is selected. Your focal distance/length is the center of the two planes, and the f-stop is the distance between the two planes. Focal length is self-explanatory. F-stop is the ratio of the lens focal length to the diameter of the aperture, but since we don't see that on our DAZ cameras, the planes serve as a guide to the ratio. Each plane should tell you where the blurriness starts. A higher ratio will give you a larger Depth of Field by shrinking the aperture. Lower ratios give you a more shallow Depth of Field. This can be counter-intuitive while using Studio, as a more shallow DoF is a narrowing of the two DoF planes. So don't think of the planes distance as the actual ratio. It literally tells you where the camera view starts to blur.
Keep in mind that when you move the camera really close to the subject, the F-stop gets really touchy because of what the planes represent. You can counter this by adjusting the other camera settings, or do what I do and render the subject and backgrounds separately then applying DoF in post. Otherwise you'll be running a lot of test renders to get what you're looking for. You won't ever find what you will see on an actual camera lens and if you apply that real world lens guide you might not get the results you're looking for. Studio's a one trick pony when it comes to its camera. It does very well for distance, and f***-all for anything even close to macro. I can photograph a spider the size of a pencil eraser on one of my plants and get a fantastic DoF surrounding that spider, on my point-and-shoot Kodak in manual mode, but that won't work in Studio's camera. It simulates a camera and its lens but the numbers are counter-intuitive and you have to mess with sliders while running test pass after test pass. I would kill for an actual lens view in Studio, it would save me a lot of time.
To help with this Studio DoF setting I turn on Display Persistence for the camera using the DoF feature, then you'll always see those guides in the scene no matter what view you are using, or what you have selected. I highly recommend using this feature when using DoF or anything outside of default camera parameters. This way you can see exactly what's in frame no matter what view you're in. So, for instance, positioning external lights that show up in the camera, are easy peasy when display persistence is turned on. No need for having multiple view panes open. I only do that when aiming eyes with what I call an "eyeline" camera but that's another ball of wax. But for those who are curious, here's an article explaining eyelines:
https://www.backstage.com/magazine/article/eyelines-film-guide-74961/
Keep in mind that when you move the camera really close to the subject, the F-stop gets really touchy because of what the planes represent. You can counter this by adjusting the other camera settings, or do what I do and render the subject and backgrounds separately then applying DoF in post. Otherwise you'll be running a lot of test renders to get what you're looking for. You won't ever find what you will see on an actual camera lens and if you apply that real world lens guide you might not get the results you're looking for. Studio's a one trick pony when it comes to its camera. It does very well for distance, and f***-all for anything even close to macro. I can photograph a spider the size of a pencil eraser on one of my plants and get a fantastic DoF surrounding that spider, on my point-and-shoot Kodak in manual mode, but that won't work in Studio's camera. It simulates a camera and its lens but the numbers are counter-intuitive and you have to mess with sliders while running test pass after test pass. I would kill for an actual lens view in Studio, it would save me a lot of time.
To help with this Studio DoF setting I turn on Display Persistence for the camera using the DoF feature, then you'll always see those guides in the scene no matter what view you are using, or what you have selected. I highly recommend using this feature when using DoF or anything outside of default camera parameters. This way you can see exactly what's in frame no matter what view you're in. So, for instance, positioning external lights that show up in the camera, are easy peasy when display persistence is turned on. No need for having multiple view panes open. I only do that when aiming eyes with what I call an "eyeline" camera but that's another ball of wax. But for those who are curious, here's an article explaining eyelines:
https://www.backstage.com/magazine/article/eyelines-film-guide-74961/
REPLY
! REPORT
Pushee-Ri
Karma: 36,837
Thu, Nov 14, 2024Wow - thanks for the additional information and the technical details 
Maybe we can tempt a few 3D artists to give DOF a try ... and then see beautiful, interesting or even experimental pictures in the gallery. That would be great, wouldn't it?

Maybe we can tempt a few 3D artists to give DOF a try ... and then see beautiful, interesting or even experimental pictures in the gallery. That would be great, wouldn't it?
Pinspotter
Karma: 5,561
Sun, Nov 17, 2024The best advice I could ever give regarding stuff like that, is to study actual photography. And with that, of course, I have a story to go along with it.
Back in the days when I was messing with the LuxRender engine, I posted a finished image over on deviantArt. One of my good friends at the time was a Max artist using DAZ figures and assets. He would render in Max. And he told me that the image I posted was way too dark. I called that to question as it looked fine on my monitor. We went back and forth for a bit and then he explained that he was a pro photographer and was viewing my image on a calibrated monitor. Of course I checked into this "weird" thing called calibrated monitors and learned that there are actual color calibrators you stick on the face of a monitor to "calibrate" its color, contrast and light. I took his advice and took another step by buying a colorimeter. That was over a decade ago and I still calibrate my monitors about once a year. And so whenever someone tells me that a scene I have rendered is either "too bright" or "too dark" I can tell them to pound sand because the monitor I render on is calibrated.
I can say that the single best thing I have ever done to improve my 3D rendering, was to learn basic photography. The second would be learning basic illustration composition and storyboarding. And you don't have to be an amazing illustrator to sketch out a concept that you can turn into a 3D object or a scene. I have a lot of basic knowledge under my belt, that has helped me immensely in regards to composition. That knowledge includes producing and directing a room in an annual haunted house event. Believe me, learning stuff art-wise and production-wise outside the enclosed 3D digital art space is highly recommended. And I've had arguments with peers about post work among many other things. I say, the more you add to your wheelhouse gives you more of an edge. There's a very good reason why I have several books on film composition and script writing wishlisted right now on Amazon.....
Back in the days when I was messing with the LuxRender engine, I posted a finished image over on deviantArt. One of my good friends at the time was a Max artist using DAZ figures and assets. He would render in Max. And he told me that the image I posted was way too dark. I called that to question as it looked fine on my monitor. We went back and forth for a bit and then he explained that he was a pro photographer and was viewing my image on a calibrated monitor. Of course I checked into this "weird" thing called calibrated monitors and learned that there are actual color calibrators you stick on the face of a monitor to "calibrate" its color, contrast and light. I took his advice and took another step by buying a colorimeter. That was over a decade ago and I still calibrate my monitors about once a year. And so whenever someone tells me that a scene I have rendered is either "too bright" or "too dark" I can tell them to pound sand because the monitor I render on is calibrated.
I can say that the single best thing I have ever done to improve my 3D rendering, was to learn basic photography. The second would be learning basic illustration composition and storyboarding. And you don't have to be an amazing illustrator to sketch out a concept that you can turn into a 3D object or a scene. I have a lot of basic knowledge under my belt, that has helped me immensely in regards to composition. That knowledge includes producing and directing a room in an annual haunted house event. Believe me, learning stuff art-wise and production-wise outside the enclosed 3D digital art space is highly recommended. And I've had arguments with peers about post work among many other things. I say, the more you add to your wheelhouse gives you more of an edge. There's a very good reason why I have several books on film composition and script writing wishlisted right now on Amazon.....
I've done a few renders that utilize DOF. It can sometimes help with the End-of-the-World problem where the scene ends and the skydome begins, as that can be rather jarring sometimes.
REPLY
! REPORT
Pushee-Ri
Karma: 36,837
Fri, Nov 15, 2024Clever, pragmatic and good 
... and once again I'm only talking about experimenting
Thanks for your comment

... and once again I'm only talking about experimenting

Thanks for your comment
I thought I'd share my usual go to for focus, particularly for dialing it in.
After setting up shot, slide to the perpendicular of the scene/camera planes in perspective view with camera selected, with your DOF planes visible.

Slide the fstop or set to extremely low setting and it'll be a little more exact where the plane of focus is. The fstop here and previous is highlighted in yellow.

Now the DOF planes can be moved more accurately where they should be, ideally between the eyes, or more specifically, the irises.

restore fstop to original settings or whatever you desire.

final render @22 fstop

After setting up shot, slide to the perpendicular of the scene/camera planes in perspective view with camera selected, with your DOF planes visible.

Slide the fstop or set to extremely low setting and it'll be a little more exact where the plane of focus is. The fstop here and previous is highlighted in yellow.

Now the DOF planes can be moved more accurately where they should be, ideally between the eyes, or more specifically, the irises.

restore fstop to original settings or whatever you desire.

final render @22 fstop

REPLY
! REPORT
dirtrider00
Karma: 16,551
Mon, Mar 10Good Post! This is actually my goto method 98% of the time though its still good to know how to do it using the main camera only simply because I've had some tight scenes that its just quicker to do it through the main camera.
Pushee-Ri
Karma: 36,837
Mon, Mar 10Many thanks for the information and especially for the great screenshots 
