Bullets.rar [1.3Mb] – C# 2.0 (VS.NET 2005)
This screen-space shader simulates the hot-air trail left behind by a flying bullet, with chromatic dispersion; similar to the effect that can be seen in the Slo-Mo mode of F.E.A.R. It was originally made for TV3D forum user BeDi.
- Uses a tangent-space normal-map on a plane
- Chromatic dispersion is also supported, but can be disabled. This effect is not physically correct, it’s just a lookup that is made for each color channel (R, G, B) each with slightly more refraction, and then added up to get a gradient on refactive parts
- An orange coloring is also made on the bullet trail to make it look “hotter”
- The environment has to be rendered on a separate rendersurface, and the bullets use that surface for distortion
- Z-Axis billboarding is used to make the bullet planes always face the camera, while having chosen X and Y orientations
- The opacity of the trails is settable with an effect parameter, which makes the effect fade as the bullet goes away
- Shader Model 2.0 minimum required… texture projection in SM1.4 is suicide
Bullets.avi [5.8Mb] – Video of them in action!