Sunday 7 November 2010

Protip: heres a trick to getting a good DOF effect with no cost to render time

 :) Here's a great trick that some of you might find useful if you ever get into 3d rendering. Personally its one of my favourite cheats in 3d and if you ever find yourself in a tight deadline it could really lighten the situation for you.
Its how to fake a depth of field effect with no cost to rendering times. Usually if you were to do a DOF effect directly in the render  you would set up your camera to  work as a physical camera, add a lens shader like a bookeh effect which would simulate the depth of field you get using a real camera, but this can drastically increase you render time because the render engine has to compute the blur in real time across a 3d space. However you can just render your scene with no blur and also render out a Zdepth pass ... which looks a little like this.
What it is is a greyscale representation of the whats found in the z-axis. So the closer something is the blacker it is. Now you take this image into photoshop and paste it into the alpha layer of the original rendered image, load up lens blur from the effects list and just click on the part you want to focus on. This is what you get as a final result.
:) Check out the preview. Its as simple as that and faster than anything around and looks great. Also this is crucial if you really want to get a photo realistic image because this is one of those small details that make a good image great.

47 comments:

  1. wow nice tips, this will help me allot with my new project, when I get to that stage !

    ReplyDelete
  2. dude this stuff is beyond me but it seems interesting keep up the posts im supportan yuh

    ReplyDelete
  3. awesome thanks for this i love playing with photo shop and was looking at 3d things , thanks

    ReplyDelete
  4. Thanks for the tips, great image.

    ReplyDelete
  5. very nice tip. Unfortunately I don't even know how to do any of this rendering stuff :(

    ReplyDelete
  6. Thanks for the advice, great post.

    ReplyDelete
  7. this looks so fricking awesome

    ReplyDelete
  8. great tutorila is that 3dsmax

    ReplyDelete
  9. 3d rendering technology is awesome

    ReplyDelete
  10. Very helpful, thanks. Though i could never even attempt it.

    ReplyDelete
  11. Nice tutorial on doing this, thankyas

    ReplyDelete
  12. I never thought about it that way...

    ReplyDelete
  13. Waiting for you to update your blog man, can't wait.

    ReplyDelete
  14. It's interesting the see the technical details behind what I would normally see as 'a can of coke on a stick'

    ReplyDelete
  15. really nice tip ! I love that shallow DOF effect ! :D

    ReplyDelete
  16. very cool, thanks!

    ReplyDelete
  17. You know a lot about this, great tip!

    ReplyDelete
  18. hmm thats really neat. wish i could use it.

    ReplyDelete
  19. i really need a new video card - I can't render anything

    ReplyDelete
  20. Usefull info , if i could ever use it lol

    ReplyDelete