I would like to use a blur effect but only on certain objects. Is there a way I can put these objects on a certain layer, and have the blur only affect that layer?
asked Apr 28 '10 at 08:10 PM
Not sure if you can do it with a single camera, particularly given the nature of post-processing filters on the graphics card, but under certain circumstances you may be able to do it in multiple layered renders.
On one camera set to the full game screen, render only the layers you want sans-blur. On another camera set to the same params outputting to the same space, render only the layers you want blurred. If objects in the two layers don't intersect or clip eachother, just be sure to set the render order of the far-stuff camera to before the near-stuff camera and you should be set.
Otherwise, you may need a third pass and some special programmatic shader work to render a clipping mask texture (render ALL layers with a shader/filter that, rather than outputting to screen, writes a 0 to a texture when the rendered pixel is from one layer group and a 1 when it's from the other) and then plug that clipping mask into a filter on one camera or the other so that pixels only get drawn to the screen if they're part of what ~would~ be seen in that camera's layer set if it was being rendered with everything else.
answered May 06 '10 at 09:40 PM