Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

DrN

Laser Bolts

This topic is 5824 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

Does anyone out there know of a link to some code or a good description of how to make a visually impressive laserbolt (for a simple space/combat sim). Thanks for your time, DrN

Share this post


Link to post
Share on other sites
Advertisement
I went with a "particle-effect" laser bolt for my game.
Basically you can achieve pretty cool results with just an
array of x*y laser particles (formed in a shape of a rectangle).
The front particles have brighter colours and larger alpha-blending values. As the laser bolt travels through space, its tail looses brightness and the alpha values of the trailing particles become smaller.
It looks pretty cool in my game.
Another approach could be a cool texture made in Photoshop (or something similar). You would just render your texture on top of a rectangle. If the texture looks impressive, then the laser will also look fairly impressive. Then you can decide on whether you want alpha blending enabled on your texture and you can also manipulate the colour of it (though I don''t know how to manipulate individual pixels of a texture in real time in OpenGL).
I decided to go with the particles for my laser, but several other weapons for my space ship, I implemented with textures.

Cheers,

TommyB

Share this post


Link to post
Share on other sites
What you are describing there is not a [physically accurate] laser
Anyway, manipulating individual pixels in a texture, in OpenGL is pretty simple, actually. Just use glTexSubImage2D()

Height Map Editor

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!