Doing shafts as a post effect only works when you can see the lightsource, because you'll have to render the source as a bright dot/sprite/sphere(or whatever), then create blur-streaks. For outside scenario's it works good & fast. Eventually you can use it for (mutiple) indoor lights as well. Like I did here:
http://3.bp.blogspot...0/HookBeast.jpgA bright sprite is behind the monster. You can't see the sprite, but it will be rendered in a special pass required for the blurring. Here another one. Notice that you won't get perfect shafts between all that detailed fence wires, unless the you are nearby enough to render the fence sufficient in the (smaller) pass that renders black objects and source spots into a texture:
http://2.bp.blogspot...ShaftMethod.jpgHowever, if you can't see the source (for example, in a long corridor where the sun comes in via windows on the left in such a way you can't see the sun), you won't get any shafts. So I switched over to a technique that shoots rays between the pixels in front of you(scene depthMap) and the camera. For each step (you need a lot), you test if it intersects shadowMap(s). It gives pretty accurate results, although it costs quite a lot more of course. You can gain speed with tricks like ATEFred suggested.
http://2.bp.blogspot...Light_Shot4.JPGAs for the cool color effects & dust within the ray like you see on shot 3. You could store a depth or 3D position for the shaft pixels (in the raymarch pass). Then later when upscaling to full-screen, you can use that info to sample from a 2D or 3D texture with animated dust. The blue colorizing... no idea how they did that. Probably some cool formula based on camera angle, traveled shaft distance, and some magic