The online racing simulator
Depth of Field tutorial
(12 posts, started )
Depth of Field tutorial
It's about time I give something for the community and .. actually release it

Anyways, this is a tutorial that I though of .. today and just worked on it the past 15 minutes and I'd like to share it with those curious.

Supplies:
3dsmax (or any 3d program)
Photoshop (or anything that supports alpha blurring)

Step 1:
Get a good camera and render your scene!


Step 2:
Press "8" to go to environment settings, and near bottom select "add" and select fog.
Depending on the scene, your variables may vary.


Step 3:
Select all objects, and make a new material, and make it black, and make sure it does not reflect or anything. and render.
(NOTE: When saving, save as a lossless format (PNG or Tiff), so you don't get artifacting in the next step!)


Step 4:
Open the fog render in photoshop and increase the contrast until you get.. well, enough contrast!


Step 5:
Merge the two renders in photoshop using the lens blur feature.

To do this, open both pictures in photoshop, copy the fog render ontop of the first render, click on the eye (to hide it), then next to layers click on "channel", and click on new channel and it should come up as Alpha 1. Paste the fog render into that. Then, go to "Filter" on the top menu, and then "Blur" and then "Lens Blur"


(This of course isn't the greatest show off of what it can do, but I believe you guys will get the idea of how to do this, and might put it to good use.)

Like I said, I know the final picture isn't pretty, but it's the idea, it was used dramatically so you guys will see a difference.
Attached images
1.jpg
2.jpg
2_edited.jpg
3.jpg
fog.jpg
#2 - robps
You might be making that harder than it needs to be.

Both Cinema 4D and Modo both can output 'depth' images, I assume that 3D Studio and other renderers can do the same?

In C4D you enable Muli-Pass Rendereing and add a Channel called 'Depth'. I won't explain it for Modo, as I'm probably the only person here who uses it the below images were done in Modo.

http://www.conedodgers.com/members/robps/depth.png
plus
http://www.conedodgers.com/members/robps/orig.png
using your Step 5
equals
http://www.conedodgers.com/members/robps/XRR.jpg

It's easier to setup a camera before you render to add depth of field, but the above is much quicker.
In 3Ds max, you can use render elements and render out the Z-depth, adjust the Z-min and Z-max parameters and you will get the same alpha mask for your photoshop blur.
Never knew you could do that with render elements :S

Aww.. thats annoying lol

edit okay, new tutorial!

Press F10, click on render elements tab, select add, go to bottom of list and select ZDepth, and then set in the distances (may take a few tests), and then follow the Photoshop section of my tutorial above to get the blur.
Quote from robps :I won't explain it for Modo, as I'm probably the only person here who uses it

Guess again

(no, I'm not asking you for a modo tut - I know it pretty well )
#6 - ZORER
So rendering the z-depth will save us so much time by not rendering the multi-pass depth of field camera views... That sounds cool!.
btw: z-buffer works well in many cases, but is some times not very sufficient.

Also, z-buffer often doesn't contain transparency info, meaning that the DoF effect will be wrong through windows etc.
#8 - robps
Quote from r4ptor :btw: z-buffer works well in many cases, but is some times not very sufficient.

Also, z-buffer often doesn't contain transparency info, meaning that the DoF effect will be wrong through windows etc.

what I normally do is enable the 'material overide' in Mental Ray to set the whole scene in a standard opac material, then render the Zdepth pass. I also use that for render an A.O. pass.

When you disable it, it goes back to your original materials.
Heres my try, with blender

Please tell me what you think.
Attached images
FZR FXR big.jpg
A bit dark and probably too much noise on the blur.
Here is a new try
Attached images
XRT DoF.jpg

Depth of Field tutorial
(12 posts, started )
FGED GREDG RDFGDR GSFDG