Jump to content

Better engine exhaust particle effects


ZRM

Recommended Posts

Have you ever been irritated by the way exhaust particles unrealistically "expire" all at the same time so that engine exhaust trails have a fixed length behind your rocket/aeroplane for any given speed? I propose to take a hint from the way that Orbiter 2010 manages exhaust particles, so that older parts of the exhaust are represented by fewer, larger particles, by slowly expanding particles and randomly deleting them over time. This makes for a much more realistic experience. Now I have looked into this and it seems that this simple behaviour cannot be achieved using the standard Unity particle system. So I will have to use a custom particle manager. This sprite manager looks ideal. Being freed from the Unity particle system should also allow better exhaust glow effects, and potentially much better particle shading.

Now, I am not going to work on this immediately since I am currently working on the next release of KerbCom Avionics, but this is on my to-do list. This thread has been started to see how much interest there would be in improved particles in KSP.

Link to comment
Share on other sites

I've played with Unity particles, and I think it's very much possible. As long as MinEnergy and MaxEnergy are different, you'll have some particles dying before others, and you can use SizeGrow to make particles grow (regardless of remaining energy). To make sure they fade out nicely instead of instantly popping, set the last color animation frame to black (or transparent, depending on the particle shader you're using). If the energy and sizegrow stats aren't enough to get the desired effect, you can manually manipulate particles.

Link to comment
Share on other sites

I've played with Unity particles, and I think it's very much possible. As long as MinEnergy and MaxEnergy are different, you'll have some particles dying before others, and you can use SizeGrow to make particles grow (regardless of remaining energy). To make sure they fade out nicely instead of instantly popping, set the last color animation frame to black (or transparent, depending on the particle shader you're using). If the energy and sizegrow stats aren't enough to get the desired effect, you can manually manipulate particles.

The growth rate being dependent on the lifetime is the problem I was running into. It seems that the settings you mention are specific to "legacy" particle systems. Can such effects be created with the new system? Or should I avoid the new system?

Edit: Hmmm... Using the legacy system it does not look like I can specify curves for each parameter. This means that the rate at which particle size grows does not fit the rate at which particles decay and disperse, since I can only have a linear growth rate.

Also I may see if I can use a "Trail Renderer" for long distance rendering of contrails.

Also, the possibility of manually manipulating particles looks like a very good idea to get a more "physically accurate" (in the loosest sense of the phrase) result. Thanks for that Majiir. I guess I should have just asked on IRC.

Edited by ZRM
Link to comment
Share on other sites

Sounds like a good idea. It would look better, but would it have any associated drawbacks, such as reduced framerate?

Depends, really. However one thing I can say is that it should be possible to get much better quality than the current effects with the same performance.

Link to comment
Share on other sites

From the PartTools 0.20 readme:

KSPParticleEmitter

PartTools now also supports a particle emitter, KSPParticleEmitter which is included in the PartTools package. Unity native particle emitters will not work as they are not fully serializable. KSPParticleEmitter is based upon the legacy particle emitter, see the unity docs for information, however it also supports a variety of emitter shapes.

The KSPParticleEmitter is fully animatable via the standard unity animation system like other PartTools assets.

To create a material for a KSPParticleEmitter use the two included KSP/Particle shaders. There is an alpha blended and additive shader.

Have you tried working with this? I wasn't able to get it to work outside of the editor.

Link to comment
Share on other sites

There are far cheaper ways to do smoke/fire effects other than paticles (which are extremely spendy with overdraw). In Bioshock, we did a lot of smoke effects with a modeled plane, which was extruded out and curved some. Then a small smoke texture was animated on the U channel and was distorted with a normal map (also how we did fire). The look is very convincing and is way cheaper to render. But it would take some decent code to get that working in KSP. Something to consider, however.

Link to comment
Share on other sites

There are far cheaper ways to do smoke/fire effects other than paticles (which are extremely spendy with overdraw). In Bioshock, we did a lot of smoke effects with a modeled plane, which was extruded out and curved some. Then a small smoke texture was animated on the U channel and was distorted with a normal map (also how we did fire). The look is very convincing and is way cheaper to render. But it would take some decent code to get that working in KSP. Something to consider, however.

Do you mean the geometry is like a ribbon in space behind the engine? I think there is support in Unity for that - there is something called "Trail Renderer". I am planning to see if I can use that for contrails that are far away from the camera or a long way from the vessel, and particles for up-close effects.

Link to comment
Share on other sites

From the PartTools 0.20 readme:
KSPParticleEmitter

PartTools now also supports a particle emitter, KSPParticleEmitter which is included in the PartTools package. Unity native particle emitters will not work as they are not fully serializable. KSPParticleEmitter is based upon the legacy particle emitter, see the unity docs for information, however it also supports a variety of emitter shapes.

The KSPParticleEmitter is fully animatable via the standard unity animation system like other PartTools assets.

To create a material for a KSPParticleEmitter use the two included KSP/Particle shaders. There is an alpha blended and additive shader.

Have you tried working with this? I wasn't able to get it to work outside of the editor.

Not yet. I will have a look at this after I finish up my next KCA release. I will probably be using a plugin to generate the effects, so serialisation is not so much of an issue, I think. We will see.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...