Jump to content
  • Advertisement
Sign in to follow this  
Ey-Lord

OpenGL Special effects ?

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

Hello guys ! I'm working on a 2D , action-rpg . I'm wondering how can i render spells, FX and so ... I obvisouly can use sprites , but what else can i do ? Is there other solutions ? ( maybe for better looking things ) If you got any link on this subjet it would be cool . I'm using openGL . Thx !

Share this post


Link to post
Share on other sites
Advertisement
Emm, that's a pretty vague question. It would be better to tell us what kind of effects you want to do, what have you tried so far, and why the results are not satisfactory to you. You can take a look though in the resources section, there are articles on how to perform various special effects.

Share this post


Link to post
Share on other sites
Ok, ill try to be more precise , i wana do many effects including those example :

- a fire ball
- some shining / glowing aura, or "ray" when a spell is casted

or ( just for example ) , one of the frost spell in WoW , where a character is stuck in some ice prison / ice spike .

What i've tried yet ? nothing really , i 'm trying to get more information before i really start something .

The only thing i've done is to start a particles engine , but i've got some ugly resuly ... and it seems hard to get nice effect from particles .

Share this post


Link to post
Share on other sites
One of the most important tricks you can use for cool glowy effects is simple additive blending. If you take a particle or a beam, and simple alpha blend it using translucency onto the screen, it has a tendency to look bland and boring, and 'non-glowy', somewhat muddy in appearance. For example, this group of blended orange particles:


In this case, the particles maintain their own distinct, separate nature with no cumulative effect. However, if you apply the same particle a few times on the terrain using additive blending (ie, the particle color is added to the scene color, rather than replacing it) then particles 'stack' on top of each other, increasing brightness with each one for that bright, glowy appearance. This image uses the same exact particle, but with additive blending (a few times applied for brightness). The more times you add in a particle, the brighter the resulting effect:



Simply by spawning upward-moving particles from a point, and using a dull orange particle texture, you can create a fairly decent flame. The right starting color has a tendency to increase in brightness through the yellow shades toward white incandescence at the flame's center.

Additive blending is also useful for beams and lightning bolts. For these, you can simply map a 'beam' texture (like a particle, but different) onto a long, skinny quad and apply some additive blending. For instance, this beam texture (though you would want to add an alpha channel fading out from center; alpha doesn't export to jpg)

could be additively blended onto the terrain to create a decent laser-beamish looking bolt:


A trick that is handy for lightning bolts is to use two beam textures. The first is a wide spread, faint 'halo' texture and the second is a narrow, brighter central beam texture. The halo is rendered using a dim electric blue, and the beam is drawn on top of it using a brighter white. Gives the impression of the air surrounding the bolt being ionized and glowing.



Star-shaped and sparkly particle textures are useful for bright points of light, faint circles can be useful when applied to an expanding quad for generating an expanding shockwave ring effect. Particle textures applied with subtractive blending can be useful for smoke rising from fires or burning rubble. Etc...

The thing is just to experiment with different blending modes and different geometries to get the effect you desire.

Share this post


Link to post
Share on other sites
Exactly the kind of post i love !
Thanx you :)

I learned a few things ( on the end especially ) . I knew about the additive blending thing :)

I'm currently using very small particles ( 5*5 ), i assume you used much bigger particles ? ( for exemple how many particles ( and size ? ) you used on your first "flame" ?

Thanx again :)
Any tips like that are realy welcome :p

Share this post


Link to post
Share on other sites
Yeah, bigger particles lets you use a lot fewer of them for good effect. My particles tend to be in the 32x32 to 64x64 range, though for very tiny puffs of flame I may use 16x16. I don't think I've ever used anything smaller than that, though; too uneconomical to render so many particles. The particles in the first two shots above were 32x32, though with the alpha effect and the fade-out their effective area seems about half that. That first flame was maybe 8 of the orange particles.

Share this post


Link to post
Share on other sites
The size of the particles is fairly easy to determine while you work on your effect. Each effect has a different optimal size.

For instance, if you're trying to create a flame system, it's best to use medium-sized particles that will shrink a bit over their lifetime. If you're trying to create a smoke-based effect, you're going to want the particles to start out fairly large, and then increase the size (and decrease the visibility of it, ie. increase the translucency of it) as the particle's life goes on.

Basically, just play with the effects; alter the particle system parameters a bit here and there and eventually you'll custom-tailor your system to a near-perfect state for whatever effect you may be working with. Some of it is common sense, some of it just comes from experimentation, some of it has a physical reason for being (such as the smoke expanding over time).

Share this post


Link to post
Share on other sites
I treid something ... i know i'm missing something so it looks like a fireball but i dont know what ...any ideas ?

http://max.cat.free.fr/Release.zip

Edit : after spending a day on it ... it looks better :D

[Edited by - Ey-Lord on August 21, 2005 1:21:06 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by VertexNormal
For these, you can simply map a 'beam' texture (like a particle, but different) onto a long, skinny quad and apply some additive blending. For instance, this beam texture (though you would want to add an alpha channel fading out from center; alpha doesn't export to jpg)


Your given texture would work just fine without an alpha channel, right? For additive blending you don't need an alpha channel; your black pixels will not show up. Although you can definitely get cool effects using additive blending AND alpha channels AND vertex alpha (to fade the entire effect in and out.)

Your next step might be to make these additive blend/particle systems be animated and not just particles, using texture coordinates. Here is an explosion (relatively low-quality) you could use to test your code, 8x8 frames:




Share this post


Link to post
Share on other sites
Quote:
Original post by Ey-Lord
http://max.cat.free.fr/Release.zip


Fireball looks fine, but why are we downloading a 6MB program that has all kinds of files but only shoots a fireball up repeatedly?

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!