Sign in to follow this  
seanmusgrave

Allegro beam effect

Recommended Posts

seanmusgrave    122
Hello, I'm working on my first Allegro game, Ghost Hunter. One particular graphic effect is the beam of light shot from the the main character's rifle. This is pretty close to the desired effect, with the gradual, smooth focus of light towards the center. Its a pretty simple trick, by drawing lines incremently to the left and right of the center line and more translucent. It breaks down however, when the beam isn't pointed vertically, as lines will criss-cross with each other and create weird artifacts: And when its pointed very strongly to the side, it starts to look downright crappy: What would be the best way to achieve the results of the first picture but applicable to any angle instead of just strongly vertical ones? Thanks! Sean Musgrave

Share this post


Link to post
Share on other sites
Hnefi    386
I think the cheapest solution is to simply store the beam as a png, drawn in Gimp or whatever, that you render with the appropriate rotations and scalings. It should be a lot faster than your current solution, in addition to solving the artifact problem.

Share this post


Link to post
Share on other sites
Hnefi    386
Well, you can always use the same image format as you've used for the ghosts. The important thing is that it needs an alpha channel, which the ghost images seem to have.

Personally, I use glPng. You can find it at http://www.wyatt100.freeserve.co.uk/download.htm

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