Jump to content
  • Advertisement
Sign in to follow this  
Raduprv

OpenGL Making spell effects

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

One thing we don't have in EL is spell effects. I want this to change after this update (I mean, start working at it after this update) and was wondering how would one do them in OpenGL. I want the 'standard' stuff, such as a lightning bolt from player A to player B, poison clouds, and stuff like that. I have no idea how would I do the lightning bolt, for example. I guess it should be 2d, but the thing is, it's length and shape are not the same, depending on the distance between the players, number of players that lightning bolt affects, etc.

Share this post


Link to post
Share on other sites
Advertisement
First of all you really wanna have a somekind of particle system, especially as you said you're using opengl. It's very easy to put together a relatively powerful system at least in 2D. I'm just finishing my particle system and it's more or less a direct copy of Haaf's particle system and I could easily create smoke effects, poison clouds, spell buffs etc. with it. Download and play with the Haaf's ystem for sometime and think of how you'd implement the stuff for yourself (http://hge.relishgames.com/downloads.html). Essentially it's just a bunch of sprites controlled by your particle system/emitter class and blended with additive blending (glBlendFunc(GL_SRC_ALPHA, GL_ONE)), but you might wanna try other modes too.

I've never done any lighting bolts, but first thing that comes into mind is recursively creating a somekind of tree which contains a path of lines from start position to end position and an arbitraty number of branches. You also might wanna make the generation of bolt as parameterized as possible to easily tweak the looks of bolts, like the size of angle, length of segments, etc. etc.

The lines could be rendered simply as GL_LINES. One segment could actually consist of 3 lines which are on top of each other. Gradually make the lines thinner and more opaque from outer to inner. Possibly blend with additive blending to make it look better. Another possibility would be just rotated quads with repeated texture.

Share this post


Link to post
Share on other sites
Yo are definitely going to want a particle system, for clouds, sparkles when lightning bounces off shields, fire, smoke... I guess the list is endless.
As for a lightning bolt, I would try dividing the distance between players into equally sized segments, and adding a random offset at each segment, to give a jagged line. Then render about 3-4 different bolts on top of each other.
This gives a 'Star Wars' Jedi lightning effect, and one can work from there.

Share this post


Link to post
Share on other sites
You can use an animated mesh and an alpha texture to make auras. You can look at this thread to see some examples. In the first image there seem to be a quad on each hand with a billboarded sprite, another in the floor and some particles swriling around the character.

Share this post


Link to post
Share on other sites
Yes, that can be done relatively easely (especially the way it is done in WC3). Just project it on the ground plane.
Another nice spell effect can be achieved by using animated alpha blended meshes.
One more effect can be used by drawing halos around players. Speaking of that, anyone has an idea how to draw a 'fluffy' halo?

Share this post


Link to post
Share on other sites
What do you mean with 'fluffy'? If I understand you right, you could scale up the mesh a little and smooth it or use some type of convex hull. But all this depends on mesh topology.
Hmmm, can you post a screenshot of this effect? Maybe we can come with a possible solution.

EDIT: i found some screenshots of WoW showing what you can do with a few triangle strips and particles
Screenshot 1
Screenshot 1

Unfortunately i haven't found any halo effects.

[Edited by - YengaMatiC on July 10, 2005 3:02:32 PM]

Share this post


Link to post
Share on other sites
Talking of Halo's and Aura's here's a link to something I did years ago that might be of interest.
The Aura Effect
Theres a pretty good explaination of how its achieved on the page (in essence its just like computing a shadow volume from the visible edges of the model). There is even a demo of it working. There are a few issues I never got round to fixing such as the aura not appearing on the insides of open objects and much more could be done with the textures to create more interesting effects.

As for blurry halo's I would have thought some bloom filter (glow) method but where you apply the resultant glow to the screen before rendering the entity you generated it for should work.

Share this post


Link to post
Share on other sites
Quote:
Original post by YengaMatiC
What do you mean with 'fluffy'? If I understand you right, you could scale up the mesh a little and smooth it or use some type of convex hull. But all this depends on mesh topology.
Hmmm, can you post a screenshot of this effect? Maybe we can come with a possible solution.


By 'fluffy' I mean blurry. And I don't want it to be on the contour of the units, but like in an oval shaped spheroid to engulf the unit (like a force field).

Share this post


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

  • 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!