dynamic light shafts
Members - Reputation: 187
Posted 09 March 2011 - 04:18 PM
and inside like this
The second image looks like its achived by a bloom filter, but with a directional blur. But Im wondering how the third image would be acheived?
Moderators - Reputation: 8525
Posted 09 March 2011 - 06:10 PM
Crossbones+ - Reputation: 2632
Posted 10 March 2011 - 04:01 AM
I used to experiment a bit with something relatively similar to what MJP suggested - the volume marching was implemented using standard projection and additive blends (it happened quite some time ago). It used to be quite slow for an the amount of slices required to give convincing results (especially when the blends were not additive).
I think the ray-casting operation MJP suggests is going to be fairly more efficient nowadays compared to real blend (compute instead of read/mod/store bandwidth)... I don't expect this to be fast enough to be used in action but perhaps adjusting the "step" sizing could do the trick.
I'd like to read other experiences.
Members - Reputation: 1237
Posted 10 March 2011 - 09:08 PM
Members - Reputation: 877
Posted 12 March 2011 - 12:16 PM
Prime Members - Reputation: 922
Posted 12 March 2011 - 01:06 PM
A 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:
However, 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.
As 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