Allegro beam effect
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
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.
I had trouble installing the PNG library for Allegro. If no one suggests an alternative, I'll try and figger it out.
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
Personally, I use glPng. You can find it at http://www.wyatt100.freeserve.co.uk/download.htm
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement