Posted Mart 1, 2008on:
This is a phenomenon familiar to photographers and is one that I have been obsessed with over the last couple of days. Just recently I have tried to emulate the bokeh effect in my renderings. Simply put, this occurs when an object is out of focus, and a point of light happens to be much brighter than the surrounding points.
There is a very easy way to do this using Max 2008. There is actually a mia_lens_bokeh shader that Autodesk has developed. It’s one of the hidden shaders in architectural_max.mi file, and is useful for creating this type of depth of field as well as other effects such as chromatic aberration. You can unhide the shader by opening architectural_max.mi in a text editor and where you see mia_lens_bokeh, put a # in front of where it says “hidden”. Next time you run Max you will see this shader when you click on Lens shader in your render settings. Remember to drag it into the material editor (instance) to control the properties.
The depth of field in this example was quite extreme, but I was trying to demonstrate the effect. It is important to note that this effect doesn’t work if Enable is checked under Multi-Pass Effect on your camera. In other words, let the shader on the lens do the DOF work not the camera. It will also render faster. If you have DOF on, in your camera settings, the bokeh lens shader just works on-top of this…blurring the image too much. To get the blades to show, I had to crank up my sampling to 64.