Sign in to follow this  
GeoffN

A Fast Technique for Rendering Realistic Laser Bolts

Recommended Posts

Nice, will check it out later, can it also be used for simple bullets?  Or other simple projectiles?

 

There's no reason it couldn't be used for tracer-style bullets or shorter/smaller lasers, yes. In my provided implementation, you can vary the length, width, and colour. The base texture, which is coloured in the fragment shader, could also be modified to give a different appearance (such as less/more glow).

Share this post


Link to post
Share on other sites

Would love to see more texture variations if that's possible.

 

My implementation currently doesn't support multiple textures, but this is a simple addition to make. It would be very useful, and I'll definitely add this in the future. Thanks for the suggestion.

 

Regarding existing approaches, I remember there was a demo by nvidia for volumetric lines. Here is the white paper, and here is a dx9 implementation of the technique, although I think your approach is simpler.

 

 

Interesting---I haven't seen that before. I see that they use a texture containing 4x4 tiles and select the most appropriate one based on the orientation factor. I guess the downside of this is that it requires one to build or have these textures on hand. This could be a painful process if you want different appearances (colour can be easily addressed in a fragment shader, but glow intensity would be trickier) for your volumetric lines. The paper also seems to suggest that even with their proposed corrections for smoother transitions between the textures, the effect won't be totally smooth.

Share this post


Link to post
Share on other sites

Why do you need six triangles instead of just four? Two of them seem to be completely transparent...

 

I had the same comment on my YouTube video. It just appears that the two end triangles are unused because the glow inside of the texture is relatively small compared to the texture size itself. If a larger glow (relative to the texture size) was used, those two end triangles would be coloured, too.

 

But, it's a good point---for the texture I've chosen to use in my implementation, those two end triangles aren't required because the glow is so small.

Share this post


Link to post
Share on other sites

Nice! Any idea how could you smooth out the clipping you see with interjecting geometry in the video?

 

That's a nice suggestion, thanks. There's no reason you couldn't use the same techniques that are applied when rendering soft particles, I suppose: render the depth buffer to a texture and pass this into our fragment shader. We can then adjust our outgoing fragment alpha values based on some comparison of the incoming and existing depth values.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this