   Cheaper than particles?
  Okay, so I have my first 3D space shooter under construction and it's looking V.pretty.  My heros engines are particle emitters using HLSL driven movement (motion, colour, alpha and scale are being driven from a time parameter)I'm setting up a fairly epic AI battle to test the engine but even with HLSL driven particles I just worry that the particle overhead will be too great once I start throwing all the lasers, explosions, etc.So... does anyone know a cheaper way that particles to achieve a nice shimmery thruster effect ?  Or, indeed, any way to cut corners ?  Is there a standard and time-proven method ?Here are my ideas so far, maybe some are simply unworkable but I'd really love some feedback from those who know their graphics programming.1. Create a low-poly geometry, similar to a cone or nested cones and animate their textures in the shader.  Is this a viable approach ?  Do you have any idea about the function or how to get a pseudo randomness into the shader driven animation ?  Perhaps feeding in a small texture of noise to use as a source of entropy and use time to slide a window through it?2. Forget it and use particles, as that's what they're there for.  Hmmm... I'm using 800 particles for one engine though, in close combat I'd expect over 16,000 particles from engines alone before firing breaks out... and that is after choosing a distance at which particles stop and a single sprite is used.  Is this inefficient?  How many particles do good-looking thrusters typically require and is possible to use less particles but augment them somehow ?3. Render one thruster to a texture and then render the texture for each of the ships thrusters thus saving between 1 and 5 emitters per ship (some ships have six thrusters).  The only problems with this are :- the points where the exhaust meets the engine.  I suppose I could fade to alpha=0 before it touches the ships circular exhaust, and use nice big bright billboards in the exhaust opening.- When viewed close up perspective means that even parallel exhaust emissions seem divergent.  Would that be a problem ?  Can one use "almost-but-not-quite-billboards" to get one rendered exhaust flame (the middle exhaust) into two outboard exhausts with slight visual divergence due to perspective effects.P L E A S E   H E L PI'll admit I'm a newbie... but from the beginning I have been biting off way more than I could chew, but chew it I did :)  I've rolled my own shaders and now my ships look as good as those in EVE Online.  I'd just like some pointers on how the pro's would streamline effects normally involving ridiculous amounts of particles.I'm sure there's a better way : /-GaryCh   
  Tell you what - just try it with particles first anyway. As you've already got it implemented, you can just test for yourself to see whether they are too slow.If they are, have you thought about a heat-haze effect? It's just an idea, but it might cut down on the speed issues. Off the top of my head, I imagine doing it in a separate pass, rendering the locations of the engines exhausts in white on black, blurring, then rippling, before distorting your default output with the exhausts picture. However, this is just something I pulled off the top of my head, so I have no idea if it really is any faster or not.   ;  Thanks for that Wraith.  I'm certainly going to try but I wont have any idea until the firefighting shader FX are all written and coded in, and that's a long way off - progress with the shaders is slow at present, as this is my first real attempt at 3D/Games code.Took me a week (ZERO shader experience) to figure out a shader for combining PhongSpecular + NormalMap + CubeReflection + ReflectivityMasking + EmissiveLightingMap - and that was after extensive googling of the techniques and a lot of trial and error.Perhaps I should have asked for peoples novel ideas for efficient jet engine effects that outperform a standard alphablended-particle emitter  : )I'm almost sure there's a way to make a parameterised Jet Thruster FX in pure HLSL without using multiple additive-blended quads.  There just has to be, I just have to find a way : /  I guess I'll probably have to suspend development a while and just knuckle down with shaders to work out what can and can't be done in a 1-quad solution with time-driven FX.Hmmmm... I wonder if anyone has done a 1-quad fire effect in *only* HLSL.  Now THAT would be a great place to start.../me scurries away muttering something about google -GaryCh;Quote:I'm using 800 particles for one engine though...Then cut back.Some secrets to good effects:1) Use layers.  2 minimum, 3 or 4 usually, 5 or 6 for the really special stuff.A "layer" just represents a collection of stuff in the effect.A good explosion would have 4 layers.* A big initial white flash* A fireball that fades* Smoke behind the fire* lots of little sparks or debris from the explosionFor your engine, try* a couple halo particles at the engine nozzle* big bright *blue* additive flame particles emitting at the nozzle* small bright *yellow and red* additive flame particles emitting at the nozzel with a shorter life than the blue ones.You'll end up with a nice white flame in the center. a big blue cone of flame. and little yellow/red embers whenever the smaller particles randomly shoot outside the blue cone.The key to the layers is getting each one to do something specific so you can be minimal with it, but make it look good. Get layers that give a big, general, and sweeping look to your effect. Then add layers in to give it the subtle details you wanted.2) Use the largest particle you can get away with. Use good textures to fill in the space.If you have 1000 tiny dot particles to get a dust effect, swap it for 20 large particles with a texture filled with dots.3) MINIMIZE OVERDRAW. If you are drawing opaque particles, overlap==overdaw. Use the minimal particle count to fill the volume you need. If you are drawing additive particles, then once you hit white everything else is overdraw. If you are using transparent particles (or additive), then maxamize the opacity to minimize the number of particles you need to reach the desired color.  No point in having 100 particles overlap with 1% opacity if you can achieve the same look with 4 particles and 25% opacity.If your thruster has a nice white cone in it, then you're hitting a lot of overdraw. You can reduce the particle count, increase the color/opacity, and maybe change your texture to achieve the exact same effect with significantly less particles.Mind you, this is a PSP game... but the ">Giant Clank (skip to 4:30) segments I worked on were less than 10K particles for the whole scene. Most the effects were less than 100particles per effect.Even on my latest project on newer hardware I'd still try to keep each effect down to a few hundred.  All the particles I'm used to using are calculated on the CPU, and rendered on the GPU. The most common issue we'd run into isn't the particle updates taking too long, but the fill rate getting out of hand.Edit:Also, take a look at Blunderbus and the authors discussion of the tech.  Mind you, ALL he was doing was rendering particles, but the demo manages 1Million particles at 30+fps. And those particles are doing a LOT of work to get that motion.[Edited by - KulSeran on May 21, 2010 5:13:00 AM];  KulSeran, thanks that really has given me something to shoot for.Going to fix the particle limit to 100 and then tweak everything else till it looks "good enough".  I think something else is wrong because right now if I go below 20 emissions per second it looks terrible...... now that I know 100-150 should be possible I'm going to start at the lower limit and then find out why.You're a star!No comments on 1-quad rockets using HLSL?  I did find an HLSL fire effect in one quad but the source/binary isn't available as it looks like it is part of an undergraduates first year term work.  But if fire is possible then I'm pretty sure a jet could use the same basic premise.http://programmerpete.blogspot.com/2008/02/hlsl-part-2.htmlIt would be faster as its on the card, and faster again because there is zero overdrawing involved.  I'm pretty sure I can use a noisy texture for seeding the effect.  Just need to find some way around not being in control of the pixel processing order I suppose.  If it can't be done in 1 pass I'm sure it can in 2.Thanks for all your help guys : )-GaryCh   