Add Depth of Field to a 3D Scene with Lens Blur

Add Depth of Field to a 3D Scene with Lens Blur

Tutorial Details
  • Program: Adobe Photoshop CS4
  • Difficulty: Beginner
  • Estimated Completion Time: 10 - 15 Minutes
Download Source Files

Final Product What You'll Be Creating

In today’s quick tip tutorial, we will demonstrate how to add depth of field to a scene that we will be creating with 3D objects to help improve a presentation to a client.


Step 1

First, create a new document (Cmd/Ctrl + N) and make it 600 pixels by 400 pixels. You could of course set the resolution up to 300 pixels per inch for any printed document, but we’ll keep it down to 72 for this tutorial.


Step 2

Then, we need to place the major part of this tutorial onto the scene, our business card. Choose File > Place and select your image.

Place it onto your canvas and make sure it’s big enough, we could still scale it down if it doesn’t fit well, but scaling up is something we don’t want to do because of the pixel loss.


Step 3

Now, in order to distort it in a certain perspective, you need to convert it to a 3D layer using the New 3D Postcard From Layer command. Select your layer and select 3D > New 3D Postcard From Layer. Once it’s done, take the 3D Rotate Tool in your tool palette and start playing around by simply dragging your card in any direction. A similar result can be achieved in earlier versions of Photoshop using the Distort tool or the Perspective tool, but the 3D Rotate Tool makes sure everything looks right.

Place your card as shown below. We don’t want too much inclination, only a subtle effect. You can now drag some guides on each corner of the layer to prepare the next step where we’ll need to create a reflection to this postcard.


Step 4

Use the Ruler Tool to create a straight line that joins the two corners on the left. This is going to help create a reflection that has the same height as your 3D layer.

Now, simply drag it down to the next corner and create a new guide at the new intersection. Do the exact same for the two remaining corners on the right.


Step 5

Place a second card onto a new layer and name it "reflection". An easy way to flip your image out is to simple add a "-" operator before the height dimension. Align the top left corner of the reflection to the bottom left corner of the card.


Step 6

Press Cmd/Ctrl + T, then right click, we’ll be able to bring up the transformation menu.

Select Distort and start dragging your anchor points to the appropriate intersections we just made with the Ruler Tool.


Step 7

The next step is how to make it fade to transparent. Select a big and soft brush about 200 pixels. We could also be using the Gradient Tool for this part, but I prefer the brush because it gives us a little bit of control we don’t get with the Gradient Tool.

Create a new layer mask to this layer by clicking the little mask icon at the bottom of your palette. Select this newly made mask and start brushing with a pure black the bottom area of the reflection. Bring down the Opacity value to about 20% the get a more subtle effect.


Step 8

We wouldn’t have so much depth in our scene if we didn’t have at least two elements in our 3D space, so repeat the process we just explained with another card. You should make it a little smaller since it’s farther into the Z space.


Step 9

Since our reflections are now transparent, there is a new problem which can be solved quite easily. What we need to do is to mask out the area of the front element’s reflection on the second one. To do this, Cmd/Ctrl – click the first element preview in the palette and Shift + Cmd/Ctrl – click on it’s reflection. What’s that does is it create a new selection from the selected layer and it adds the other selection to the actual selection.

Once your selection is ready, select the mask of the back element’s reflection and fill your selection with black.


Step 10

To simulate a nice laminated shine on your card, we need to create a new layer and name it "Shine". By pressing Cmd/Ctrl – click on the preview icon again, select your card and subtract a part of it using the Polygonal Lasso Tool. To do so, hold Alt and start clicking around to create your shape, once closed, it will subtract this shape to the current selection.

Fill your selection with white and mask it as we masked out the reflection using the Mask and the Brush. Bring the Opacity value down again so that it’s more subtle. Repeat the process for the second element but this time press Alt + Cmd/Ctrl – click on the front element’s preview icon to subtract it from the selection.


Step 11

It is now time to add depth of field to our scene. For those who don’t know much about depth maps, it’s a black and white map that represent the depth of each element with a value that goes from white to black, white being the focused elements. Create a new layer and fill it black because there is nothing to be focused on in the back of our scene. Using the selection method we discussed in step 9, fill the front element with white and the rear with gray. You don’t need to choose your gray well because we’ll be adjusting the blur settings in few moments, don’t worry if it’s too dark or too pale.


Step 12

Since the Lens Blur effect only affects one layer, we need to create a copy of our layers and make a single one out of them. Select all your layers (excluding the depth map we just created) and drag them onto the new layer icon at the bottom right of the layer palette. Press Cmd/Ctrl + E to merge them in a single layer or right click and select Merge Layers.

To apply the depth map on the flattened layer, hit Cmd/Ctrl + A with your depth map selected, this will select everything on the layer. Hit Cmd/Ctrl + C to copy it, we’ll need it in few seconds. The upcoming part is a great way to import black and white values to a layer mask, simply add a layer mask to the flattened image, be sure to hit Cmd/Ctrl + I to make it black and then press the Edit in Quick Mask Mode icon at the complete bottom of your tool palette.

Once the Quick Mask Mode is activated, hit Cmd/Ctrl + V to bring out the depth map we copied before, it should give you something like that. If it’s all right, press the Quick Mask Mode icon again to make a selection out of this. Click on the layer mask and fill the selection with white.


Step 13

Then, having the flattened layer selected, choose Filter > Blur > Lens Blur to bring up the effect settings.

Make sure when you adjust your settings that your source is set to "Layer Mask" in the drop down menu and that the "Invert" checkbox is checked (for some reason, Photoshop is using black as focus instead of white).


Step 14

To add dimension to the card, draw a simple dark gray line around the edge of the first card to create the impression of an extruded layer.


Step 15

Adding a floor is a great way to make it more realistic because the eye will understand more easily that the business cards aren’t floating in space but sitting on the ground. For this tutorial, I am using a texture you can easily get since it’s given in the Psdtuts+ freebies. I used "stonetexture5.jpg" that you can find in the Stone Texture Pack.


Step 16

Desaturate it by hitting Cmd/Ctrl + Shift + U, if it does not work, you might need to rasterize your layer. Choose Layer > Rasterize. Hit Cmd/Ctrl + T to bring the transformation tools and select perspective.

Scale it down about the third of your image and bring out the bottom left or bottom right anchor point to create a perspective.


Step 17

Mask out cards using the same selection method we’ve been using quite a lot before.


Step 18

Using a big soft brush, around 300px, mask out some areas we want to soften out.


Step 19

To add a quick shadow under those cards, create a new layer a paint a black spot using a soft brush.

Hit Cmd/Ctrl + T and start stretching it and rotating it so that it matches well with the card.


Step 20

Mask out the overlapping areas and repeat for the second card.


Final Image

You might want to play with these settings to get the desired effect, you could bring the opacity of the ground down a bit to make it less grungy.

Here is a similar attempt using the same exact method.

  • geir Benny Nystad

    kinda interesting, but i think it would have been more interesting if it was the same object.

    • http://www.evilonegraphics.com Trizicklo

      geir, I think you meant a different object. :D

  • Fed Up

    Next time you need someone to cover the extreme basics with a medicore outcome, call me Envato, i’l do it for half what you paid this guy. Or better your, get an intellectually disabled chimp to do it, then its free!

    • http://www.forum.theartforums.co.uk iiPod

      +1

    • Antoine Hallé
      Author

      I’m honestly sorry this doesn’t meet your standards Mr. Fed Up.
      Please note that the Tuts+ network offers a wide selection of tutorials from BEGINNER to advanced, next time, show us what you achieved instead.

      • http://raystudio.pl strony oświęcim

        even I treat myself as semi I found here couple things I did wrong way. I really like this tutorial. And you are absolutely right. Thanks for providing this one.

    • http://www.evilonegraphics.com Trizicklo

      @ Fed Up:
      It’s pretty simple, man… you don’t like it here, then you’re more than welcome to leave. No one is holding a gun at you, right? One thing is to critique the art but you’re totally disrespecting the author, which makes you look like a total jerk. If you’ve got something to show, then, what’s stopping you? I don’t think you wouldn’t like making some extra cheese writing tutorials for this community, would you? No one walks before crawling, and no one runs before walking. Get it?

      There are plenty of tutorial places out there, I’d suggest you to find one right away and move on if you feel unsatisfied by the content! If you’re as good as you think you are, then all I can say is that we expect nothing but greatness coming from you. So, get it on, show us some good stuff, and make some money!! ;)

    • http://www.vaporizerkits.com Zephyr Ion

      Especially when it’s a free tut, you can’t expect things to serve you all the time. These guys are pretty good at offering new free tuts almost every day of the year. There will be down days as there will be up days.

      • http://www.thedevelopertuts.com Bratu Sebastian

        Oh my God! This guy is probably so advanced at Photoshop that he can’t change the startup page from PsdTuts in his browser. He’s probably gonna install IE6 !!!

        That’s why he is urging you to stop posting beginner tutorials, he probably wants some really advanced, like how to change his adress bar :)

        Man, when I launch my tutorial website ( and that’s soon ), if I get 3 comments like this from the same person, I will probably block his IP and make a tutorial on blocking that guy’s IP ( plus some more checks, I would target him with a special cookie ) :)))

        LOL, the tut is amazing, and the comment is really from someone gealous.

      • Ten2Four

        Yeah, I bet he’s real “gealous” of your tutorial skills. Judging by the poor design of your “tutorial” website, I’d say that blocking someones IP through the cpanel would be the most advanced thing you could offer.

        I’m looking forward to your tutorial writing skills LOL!!!!11!! ( :) ) gealous

      • joel

        C’mon people stop reacting to this fool, thats exactly what he wants! Lets just talk design.

  • http://www.behance.net/AhmedElabbar Ahmad

    Thank for this well explained tutorial, however is it just me or does anyone feel that something is wrong with the depth of field,I can not understand why the further object is blured whilst being in the best place from a viewer’s point, I think that the blur should be added to objects very close to the viewers eye.

    • Antoine Hallé
      Author

      Everything depends on where the focus is, everything that is far from the focus point will be blurred out wether it’s close or not to the camera/eye. In this case, our focus is on the first 3D object so that the farthest one is getting blurred out.

    • http://www.evilonegraphics.com Trizicklo

      I think the problem with the DOF in this image is that the object in the back and the floor texture are not blurred enough as it would appear in real life. Here’s my own DOF version.
      http://www.evilonegraphics.com/DOF.jpg

      • Antoine Hallé
        Author

        Agreed, your version look pretty neat.

      • Martin Czwiertnia

        I agree – thought there is something wrong with the outcome – yours look more realistic and just right…

      • http://sexidesign.com Melody

        See this is why the community is great..

        This is definitely a better example..Adding more blur to the back object allows there to be depth of field now = foreground, middle, and background. Now the object looks so much clearer in contrast with the blurred one.
        Nice job =)

  • http://www.designioustimes.com/ Doink

    Interesting. It’s something similar with the Tilt shift technique by using Gaussian Blur, only cooler :)

    @Ahmad: It looks a bot odd because of the lighting.

    But the idea is great!

  • http://www.krop.com/lukeeaton/ Luke Eaton

    I like the concept for adding depth, I use blurring a lot, but the perspective is off and the there is too much blur on the item. I think it would have been better to show three items and show that as the items get further away the become more out of focus. I would suggest studying some photographs that have a low depth of field or go and take your own to get more familiar with blurring.

    • http://www.krop.com/lukeeaton/ Luke Eaton

      Also, the floor is not blurred around the back object. Everything will be out of focus, not just the object. Also, the back object is not literally blurred it is just out of focus, so the reflection that gets closer to front object should not be as blurred.

  • http://shaneparkerphoto.com Shane Parker

    Yikes. Not even close to realistic. I understand that there are “beginner” and “advanced” tutorials, but the techniques being taught, even for beginners, should have outcomes that represent what is trying to be taught.

  • Amanda

    Probably the best way to do this is adding a blur gradually on the back panel. I agree with most of these above me that it doesn’t look all that real. It’s a good concept but you can get depth of field without blurring. Just by it being smaller and behind the front object gives us depth. You’re close. but not quite it.

  • ohmno

    @Antoine Hallé: useful tutorial
    @Trizicklo: useful comments, too ;)

  • http://www.kisanbhat.com Kisan

    Nice tutorial.

    I struggled with reflections, especially with 3D objects. Let me use this technique on 3D objects.

    Thanks.

  • vanhalstd

    Nice to see this coming by, though something looks unnatural to me at the final outcome…

    I think it has something to do with the edges of the reflection, which are too sharp and the back image that is too blurry. It kind of interferes too much if you ask me (too much contrast between the two).

    • vanhalstd

      Doesn’t it bother anyone the edges left and top (especially foreground), seem to be extremely blocked (aliasing)? It kind of shouts “raster image”. Something to do with the resolution or just downscaling the imagery? Still I seem to struggle with this thing from time to time as well. Especially if you add perspective.

      Any suggestions on this (maybe a tutorial to cover it up)?

  • http://www.novastyle.org Jillian

    nice!
    I think people need to use more depth of field… it’s such a simple concept yet it adds something truly amazing to a design.

  • http://www.peewee1002.co.uk Peter Sawyer

    I love using DOF but as a photographer you can often understand how it works alittle better.

    The final image looks poor, the reflections are badly added and the whole thing looks a sham. The floor would be blurred as well (this ruins the effect completely)

    Your other tutorials have been much much better. Try again and do sometime to really wow us over. Good luck and keep it up.

  • http://www.julienzennaro.com JZ

    These look really great. Thanks a lot…

  • http://c42d.com C42D

    No disrespect to the author, but I kind of agree with the guy who said the outcome was mediocre (although I don’t agree with how he said it). Something does look off in either the perspective or the blurring. Also, I could probably create the same outcome with free distort and the gaussian blur filter in about 2 minutes, so I dont see the need for so many complicated steps, but I do respect any method for achieving final results. I guess I expected a little more, but hey, its free! And, overall, I find this site incredibly useful.

  • pixelBender

    If you look at the authors profile he is a beginner and although the tut is not perfect I think he does a good job, for those of you complaining, why don’t you make a tut and show us how it’s really done ? put up or shut up :)

  • Mykl

    This is how I see this whole tut site. While the “final product” may not be what it could be, we then get someone who tries it and takes it a little further like Trizicklo, and then of course you get people chiming in with their POV about depth of field and such.

    I personally enjoyed it, it is something to think about and take further in a project eventually.

    Thanks Antoine for the inspiration and the naysayers can pound sand.

  • http://www.designcranium.com DesignCranium

    Nice tute! Very basic, with an okay outcome, but it does give the beginners some good tips. :D

  • Antoine Hallé
    Author

    The tutorial is much more about getting used to the basic principles of depth of field and 3D tools. The outcome may be a little wrong but I think it’s not worthless at all.

    Thanks for your support.

    • http://shaneparkerphoto.com Shane Parker

      Ya, but the “basic principles” are where this tutorial failed! You would not study this tutorial to learn how to do depth of field in 3D space if you wanted to do it properly.

  • http://www.tripledracing.co.nr Triple D Racing

    Im not the best at photoshop. I can do some advanced things. But this is a great tutorial for beginners.

    The only complaint about this is the weird scaling of the ground texture and the dicks who complain about the free tuts on here. Go buy the premium package and go do some good tutorials or get off this site. :D

  • http://www.ebuyshoesstore.com shirley

    This is cool!! loved doing it!

  • david

    WTF is wrong with you “Experts”. If you care to read the descrition at the top of the page.
    It says “Beginner”.
    If it doesn’t suit you then just click & move onto something else, Don’t just rip a guy to bits.

  • http://www.bestcardprinter.com Jeff Jones

    Great and very easy to follow
    J

  • http://www.guzeltravestiler.com travesti

    Nice post. very creativy…

  • http://www.securityking.com Craig

    Great tutorial, thanks for sharing your techniques!

  • http://www.craigfordham.net Lisa

    Excellent tutorial, excellent perspective, Thank you! LT

  • http://www.cardsoftware.net Amanda Smit

    Fantastic use of depth of field, really amazing design.

  • http://www.logomondo.com Logomondo

    Another fantastic tutorial . Your site is always fascinating. Keep it up. =D

  • http://wallpaperom.blogspot.com devotee

    realy nice! i got some ida from here.