Board index FlightGear Development Effects and shaders

Afterburner / thruster flames

An exciting "new" option in FlightGear, that includes reflections, lightmaps, the particle system etc.. A lot is yet to be discovered/implemented!

Afterburner / thruster flames

Postby Thorsten » Wed May 20, 2015 9:22 am

Tinkering with the Shuttle, I've been somewhat disappointed by the options we have to render exhaust flames. While the particle system is good for large rocket flames, it doesn't render an AB exhaust nearly fast enough so that particles separate, and it has issues with thruster flames pointing perpendicular to spacecraft motion.

Most other solutions I've seen are textured cylinders/cones which simply have too sharp a boundary to be completely satisfactory. I've tried a solution stacking a series of billboarded transparent textures, which gives a nice impression, but no sense of any motion or force.

So I've taken an hour to do a procedural shader based solution to the problem. The effect simply attacks the problem by brute force and integrates over a 3d distribution of glowing stuff with a density distribution defined as a function of coordinates inside a bounding box - noise can be added at will and motion comes from bringing osg_SimulationTime into the fray translating the noise.

This still has some quirks, but the proof of concept does what it's supposed to do - provide the visuals of a 3-dim flame.

Here's a proof of concept pic - one Space Shuttle engine rigged with the procedural flame, the lower two use adapted AB flames (I think originally from the F-14b) - note that this isn't how the flame ultimately should look like for the Shuttle, just an illustration of how different it is.

Image

Since (unless you want to code GLSL for your aircraft) this relies on calling pre-defined functions for the density distribution, I think this would be a good time to discuss feature requests - what things do you need for AB flames etc? How should they look like? What should they do? What needs to be configurable?
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Afterburner / thruster flames

Postby sanhozay » Wed May 20, 2015 12:05 pm

Looking good :8

I have an application where they need to be flickering and emissive. Colour and volume configurable. These need quite a soft tail, rather than a point:

sanhozay
 
Posts: 1207
Joined: Thu Dec 26, 2013 12:57 pm
Location: EGNM
Callsign: G-SHOZ
Version: Git
OS: Ubuntu 16.04

Re: Afterburner / thruster flames

Postby Thorsten » Wed May 20, 2015 12:11 pm

This is actually fun - here's a demo with some physics in - shock diamonds at high air pressure when the plume is collimated, as the plume expands to a characteristic parabolic shape, they fade away, all configurable runtime...

Image

Image

Image

Image

Image
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Afterburner / thruster flames

Postby clrCoda » Wed May 20, 2015 12:14 pm

I try my best not to just post 1+'s but dang that's very very cool!
Ray St. Marie
clrCoda
 
Posts: 1225
Joined: Wed Apr 07, 2010 12:04 pm

Re: Afterburner / thruster flames

Postby Bjoern » Wed May 20, 2015 2:53 pm

Configurable:
- Color
- Length
- Diameter

It wood be cool if there was a matching engine glow effect to boot as the plume is only (clearly) visible at higher AB stages.
Bjoern
 
Posts: 484
Joined: Fri Jan 06, 2012 11:00 pm
Location: TXL (RIP)
Version: Next
OS: ArchLinux

Re: Afterburner / thruster flames

Postby Necolatis » Wed May 20, 2015 2:58 pm

Wow, great!

Ability to change the colors?

How about heat distortion of the air (maybe trailing the AB flame when moving). (could also be used for when AB is not active)
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2233
Joined: Mon Oct 29, 2012 1:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2020.3.19
OS: Windows 10

Re: Afterburner / thruster flames

Postby Thorsten » Wed May 20, 2015 6:16 pm

Configurable:
- Color
- Length
- Diameter


Color sort of goes without saying (the question is more, in what form do we support color transitions). The others are doable by scale animation, so they need no extra support.

How about heat distortion of the air (maybe trailing the AB flame when moving).


You guys must know by now we can't do distortions - you need the color of the pixel behind and pixels nearby to do that, and we don't have that without a second rendering pass which costs a lot. We can try to fake it by playing with brightness values - maybe it works well enough, maybe not. It does work for raindrops (which in reality are refraction, but brightness variations do the trick well enough).
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Afterburner / thruster flames

Postby Necolatis » Fri May 22, 2015 3:24 am

Also how about ability to change how transparent the flame is? If it can be made fully opaque it can also be used as engine fire without augmentation, we just make it very short.

With colors I suggest a minimum of 3 colors:

shock diamonds color
Start color
End color

Else maybe a table of colors, with a position and a color, and in between interpolation of colors could be made. The table could be fixed in size, maybe 5-6 positions?

Maybe also ability for a different color at the edges like here:
Image

Or maybe a irregular flame, will the noise show stuff like that:
Image

Some flames have bigger diameter further from the engine. If you make a color table like above each position could also hold a diameter:
Image

Actually, how about defining colors by using a texture?

Just suggestions..
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2233
Joined: Mon Oct 29, 2012 1:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2020.3.19
OS: Windows 10

Re: Afterburner / thruster flames

Postby Necolatis » Fri May 22, 2015 4:26 am

I noticed you commited a afterburner flame, I played around with it.

Firstly as can be seen from the picture below, it stays in the foreground of the ubershaded fuselage.

Secondly what does thrust_density do? If I change it the flame becomes mostly black and moves away from the plane.

Image
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2233
Joined: Mon Oct 29, 2012 1:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2020.3.19
OS: Windows 10

Re: Afterburner / thruster flames

Postby Thorsten » Fri May 22, 2015 12:06 pm

Firstly as can be seen from the picture below, it stays in the foreground of the ubershaded fuselage.


Strange - I see correct z-ordering for the Shuttle. Is does the z-ordering work if you're not using the ubershader (i.e. why do you mention it)?

Secondly what does thrust_density do? If I change it the flame becomes mostly black and moves away from the plane.


Dials opacity of the emitter. Try pulling again, I think got rid of the black bug.

Else maybe a table of colors, with a position and a color, and in between interpolation of colors could be made. The table could be fixed in size, maybe 5-6 positions?


None of the flames you posted and I've looked at need such a table. It seems to me that a simple density dependent color scheme captures essentially everything.

I've now added a base flame attached directly to the nozzle which can have its own color. I think that allows quite some variety - this is how the Shuttle main engines now look during ascent:

Image

Image
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Afterburner / thruster flames

Postby Johan G » Fri May 22, 2015 1:03 pm

This looks better and better all the time. Great work Thorsten! :D
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Some YouTube videos
Johan G
Moderator
 
Posts: 6629
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit

Re: Afterburner / thruster flames

Postby Necolatis » Fri May 22, 2015 5:44 pm

Great, the black is now now fixed.

It stays in foreground without ubershader also.
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2233
Joined: Mon Oct 29, 2012 1:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2020.3.19
OS: Windows 10

Re: Afterburner / thruster flames

Postby Thorsten » Fri May 22, 2015 6:03 pm

I think I understand that as well - you're trying to shove the flame down into the engine, right?

Now, the flame is rendered inside a bounding box, but the bounding box for a collimated flame is much larger than the flame to give room for expansion (compare the first with the second of the Shuttle screenshots to see how much it can expand).

Now, the shader can not know the z-position of individual flame emitters (that'd be ridiculously expensive), so it checks for the z-position of the bounding box. In your case, the bounding box is outside the fuselage, and hence the flame is seen.

So, is there a reason you can not attach the flame to the end of the engine nozzle? It does give me acceptable results for the Shuttle, and I'm assuming your AB flame is much more opaque.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Afterburner / thruster flames

Postby Necolatis » Fri May 22, 2015 6:17 pm

Problem is that the fuselage extend beyond the nozzle to hold the reverser. On top of that there is a little tap, that extends out 15cm further than that.

But I get what the problem is, it a real shame, I had been looking so forward to using this effect. :|
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2233
Joined: Mon Oct 29, 2012 1:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2020.3.19
OS: Windows 10

Re: Afterburner / thruster flames

Postby bugman » Fri May 22, 2015 6:47 pm

Necolatis wrote in Fri May 22, 2015 6:17 pm:Problem is that the fuselage extend beyond the nozzle to hold the reverser. On top of that there is a little tap, that extends out 15cm further than that.


Try playing with the size of the bounding box with the animation scale offsets. If you can get the bounding box to not cut though any of your aircraft, the problem is gone.
bugman
Moderator
 
Posts: 1808
Joined: Thu Mar 19, 2015 10:01 am
Version: next

Next

Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 4 guests