Jump to content
  • Advertisement
Sign in to follow this  
speciesUnknown

Bullet Billboards

This topic is 2520 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I need to draw large numbers of non spherical projectiles, to create a tracer effect. I was thinking that perhaps one way to do this is via billboards. I would need billboards that are always pointing toward the screen, but still aligned by their longest axis with the direction of travel.

Right now I've implemented billboards using point sprites, using XNA's standard VertexPositionNormalTexture buffer, and an effect that uses the normal to expand the 4 points into a quad in the vertex shader:

output.Position = mul( mul( mul(input.Position, matWorld) , matView), matProjection) + float4(input.Normal.xy * input.Normal.z, 0, 0);

I encode the X and Y position of each point on the screen, and the age of the particle, into the X Y and Z components of the normal.

Is there a way I could do something similar with my projectiles? Currently, I'm drawing them all as a buffer of line strips, in a single draw call, and I don't want to lose this ability, because I want the sky to be lit up with bullets.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!