Board index FlightGear Development Effects and shaders

Particle system for exhausted reactor gases simulation

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

Particle system for exhausted reactor gases simulation

Postby abassign » Wed Nov 21, 2018 8:33 am

I'm testing the possibility of having the fumes inside the jet engine exit tube, the effect could work (the movie shows a very exaggerated effect, but it's only for the test), but I do not understand how to reduce its size. I made the shutter radius quite small (0.1 meters), but it did not change much, I reduced the phi and theta angles to just a few degrees to concentrate the jet ... but it did not change much. Reading an open-gl manual I noticed that the particle management system has a "scale" parameter at this point I suspect that this parameter is not used, or is defined, but the manual on the wiki does not show it clearly. I hope you can help me with this problem.

Video example:



Code: Select all
<?xml version="1.0" encoding="ISO-8859-1"?>

<PropertyList>

    <particlesystem>
        <name>flame_smoke_1</name>
       
        <offsets>
            <x-m>  0.000 </x-m>
            <y-m>  0.000 </y-m>
            <z-m>  0.000 </z-m>
            <roll-deg>    0.000 </roll-deg>
            <pitch-deg>   85.000 </pitch-deg>
            <heading-deg> 0.000 </heading-deg>
        </offsets>
       
        <texture>Pictures/smoke.png</texture>
       
        <condition>
            <greater-than>
                <property>fdm/jsbsim/systems/engine/rpm-norm</property>
                <value>0.01</value>
            </greater-than>
        </condition>
       
        <emissive>true</emissive>
        <lighting>false</lighting>
        <align>billboard</align> <!-- billboard / fixed -->
        <attach>world</attach> <!-- world / local-->
       
        <placer>
            <type>point</type> <!-- sector / segments / point -->
        </placer>

        <shooter>
            <radius-min-m>0.1</radius-min-m>
            <radius-max-m>0.15</radius-max-m>
            <theta-min-deg>4</theta-min-deg>
            <theta-max-deg>5</theta-max-deg>
            <phi-min-deg>-5</phi-min-deg>
            <phi-max-deg>5</phi-max-deg>
            <speed-mps>
                <value>10</value>
                <spread>2</spread>
            </speed-mps>
            <rotation-speed>
                <x-min-deg-sec>00</x-min-deg-sec>
                <y-min-deg-sec>00</y-min-deg-sec>
                <z-min-deg-sec>00</z-min-deg-sec>
                <x-max-deg-sec>00</x-max-deg-sec>
                <y-max-deg-sec>00</y-max-deg-sec>
                <z-max-deg-sec>00</z-max-deg-sec>
            </rotation-speed>
        </shooter>
       
        <counter>
            <particles-per-sec>
                <value>400</value>
                <spread>300</spread>
                <factor-prop>fdm/jsbsim/systems/engine/rpm-norm</factor-prop>
            </particles-per-sec>
        </counter>
       
        <particle>
            <start>
                <color>
                    <red><value>   0.63 </value></red>
                    <green><value> 0.58 </value></green>
                    <blue><value>  0.0 </value></blue>
                    <alpha><value> 0.3 </value></alpha>
                </color>
                <size>
                    <value>0.5</value>
                </size>
            </start>
           
            <end>
                <color>
                    <red><value>   0.9 </value></red>
                    <green><value> 0.2 </value></green>
                    <blue><value>  0.0 </value></blue>
                    <alpha><value> 0.0 </value></alpha>
                </color>
                <size>
                    <value>1.0</value>
                </size>
            </end>
           
            <life-sec>
                <value>1</value>
            </life-sec>

            <mass-kg>0.001</mass-kg>
            <radius-m>0.001</radius-m>

        </particle>
       
        <program>
            <fluid>air</fluid>         <!-- air / water -->
            <gravity>false</gravity>
            <wind>false</wind>
        </program>
       
    </particlesystem>

</PropertyList>
Last edited by abassign on Wed Nov 21, 2018 1:40 pm, edited 1 time in total.
abassign
 
Posts: 791
Joined: Mon Feb 27, 2012 5:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2018.3
OS: Linux Mint 19. x

Re: Particle system scale

Postby Necolatis » Wed Nov 21, 2018 8:43 am

Its the <size> parameter you probably want to adjust.

I think 1 = 1 meter diameter texture. (or maybe is radius)

The <radius-m> is for aerodynamic drag.
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore


Hangar: https://sites.google.com/site/fghangar/
User avatar
Necolatis
 
Posts: 1941
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2019.1.2
OS: Windows 10

Re: Particle system scale

Postby abassign » Wed Nov 21, 2018 9:29 am

Necolatis wrote in Wed Nov 21, 2018 8:43 am:Its the <size> parameter you probably want to adjust.

I think 1 = 1 meter diameter texture. (or maybe is radius)

The <radius-m> is for aerodynamic drag.


WoW is ok :D

Image

Image

Thanks for the assistance!
abassign
 
Posts: 791
Joined: Mon Feb 27, 2012 5:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2018.3
OS: Linux Mint 19. x

Re: Particle system scale

Postby abassign » Wed Nov 21, 2018 10:04 am

I understood some things:

If you change the configuration of the particle system, it is not certain that the configuration is effective with a simple reload of the aircraft. But it is necessary (if there is no other technique) to completely restart the application. This problem is for the <size> and for the <life-sec> while for other parameters the simple reloading of the aircraft has an immediate effect. There are probably some problems in the code in this particular state.

However, it is possible to obtain this effect that I find very interesting, even if certainly not definitive.



This is the actual code:

Code: Select all
<?xml version="1.0" encoding="ISO-8859-1"?>

<PropertyList>

    <particlesystem>
        <name>flame_smoke_1</name>
       
        <offsets>
            <x-m>  0.000 </x-m>
            <y-m>  0.000 </y-m>
            <z-m>  0.000 </z-m>
            <roll-deg>    0.000 </roll-deg>
            <pitch-deg>   90.000 </pitch-deg>
            <heading-deg> 0.000 </heading-deg>
        </offsets>
       
        <texture>Pictures/smoke.png</texture>
       
        <condition>
            <greater-than>
                <property>fdm/jsbsim/systems/engine/rpm-norm</property>
                <value>0.01</value>
            </greater-than>
        </condition>
       
        <emissive>true</emissive>
        <lighting>false</lighting>
        <align>billboard</align> <!-- billboard / fixed -->
        <attach>local</attach> <!-- world / local-->
       
        <placer>
            <type>point</type> <!-- sector / segments / point -->
        </placer>

        <shooter>
            <radius-min-m>0.1</radius-min-m>
            <radius-max-m>0.15</radius-max-m>
            <theta-min-deg>4</theta-min-deg>
            <theta-max-deg>5</theta-max-deg>
            <phi-min-deg>-2</phi-min-deg>
            <phi-max-deg>2</phi-max-deg>
            <speed-mps>
                <value>1</value>
                <spread>0.2</spread>
            </speed-mps>
            <rotation-speed>
                <x-min-deg-sec>00</x-min-deg-sec>
                <y-min-deg-sec>00</y-min-deg-sec>
                <z-min-deg-sec>00</z-min-deg-sec>
                <x-max-deg-sec>2000</x-max-deg-sec>
                <y-max-deg-sec>00</y-max-deg-sec>
                <z-max-deg-sec>00</z-max-deg-sec>
            </rotation-speed>
        </shooter>
       
        <counter>
            <particles-per-sec>
                <value>800</value>
                <spread>200</spread>
                <factor-prop>fdm/jsbsim/systems/engine/rpm-norm</factor-prop>
            </particles-per-sec>
        </counter>
       
        <particle>
            <start>
                <color>
                    <red><value>   0.63 </value></red>
                    <green><value> 0.58 </value></green>
                    <blue><value>  0.0 </value></blue>
                    <alpha><value> 0.1 </value></alpha>
                </color>
                <size>
                    <value>0.35</value>
                </size>
            </start>
           
            <end>
                <color>
                    <red><value>   0.9 </value></red>
                    <green><value> 0.2 </value></green>
                    <blue><value>  0.0 </value></blue>
                    <alpha><value> 0.0 </value></alpha>
                </color>
                <size>
                    <value>0.45</value>
                </size>
            </end>
           
            <life-sec>
                <value>0.1</value>
            </life-sec>

            <mass-kg>0.1</mass-kg>
            <radius-m>0.1</radius-m>

        </particle>
       
        <program>
            <fluid>air</fluid>         <!-- air / water -->
            <gravity>false</gravity>
            <wind>true</wind>
        </program>
       
    </particlesystem>

</PropertyList>
abassign
 
Posts: 791
Joined: Mon Feb 27, 2012 5:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2018.3
OS: Linux Mint 19. x

Re: Particle system for exhausted reactor gases simulation

Postby abassign » Wed Nov 21, 2018 2:45 pm

It would be amazing now, but if the plane moves ... physics seems no longer to be the classic! The Galilean invariance is not respected by the particle system, but there is a sort of hybrid that does not understand how it works. A small speed is enough to see the particles exit the aircraft even if the configuration is <attach> local </ attach> and the particle speed is 0.

Code: Select all
            <speed-mps>
                <value>0</value>
                <spread>0</spread>
            </speed-mps>


It seems that the program that handles the particles does something of its own, as if a hidden function was added that gives a velocity to the particles as a function of the relative wind vector. In fact, if you drop the jet in a flat screw, you can see that the particles are similar to the smoke coming out of a chimney ... At this point I ask myself, is it possible to avoid the influence of the relative wind?


Image

Image

Image

Image

Image

Image

Image

Image

Image

In the vertical fall (in the void) this is how the particle works.

Image
abassign
 
Posts: 791
Joined: Mon Feb 27, 2012 5:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2018.3
OS: Linux Mint 19. x

Re: Particle system for exhausted reactor gases simulation

Postby legoboyvdlp » Wed Nov 21, 2018 3:17 pm

Why not use the ALS flame shader for the full afterburner? That particle soloution looks very good for the flame in the pipe, but when the flame is visible outside the pipe, the flame shader will look better than that and avoid these issues.
User avatar
legoboyvdlp
 
Posts: 6927
Joined: Sat Jul 26, 2014 1:28 am
Callsign: YV-LEGO
Version: 2018.3.1
OS: Windows 10 HP

Re: Particle system for exhausted reactor gases simulation

Postby abassign » Wed Nov 21, 2018 4:08 pm

legoboyvdlp wrote in Wed Nov 21, 2018 3:17 pm:Why not use the ALS flame shader for the full afterburner? That particle soloution looks very good for the flame in the pipe, but when the flame is visible outside the pipe, the flame shader will look better than that and avoid these issues.


Hi, I'm also using the ALS solution, but it's full of limitations. Meanwhile, the G91 does not have an after burner, while, as was typical of the era, the engine partially burns the fuel even after the outlet fan making the inside room similar to a wood oven. The image that I had obtained with the particle was a good imitation of what you could see ... first of course to burn your face :D
The ALS method to obtain the flame operates on a volume that, for an internal chamber, is not suitable as it is a parallelepiped, and the corners come out forming flames around the tail ... does not seem very realistic to me sincerely ...

At this point the particle looks great, it is mostly performed by the Open-GL, but I think someone who wrote the code, put some function that does other things, which is fine in certain contexts, for example I can use the effect in the case of a burning engine, as provided for by the G91R1B, but certainly not a normal situation.

ALS option it should be redone for the specific case involving the flame inside the turbo-jet outlet pipe. It is a situation not explored in FGFS, but that certainly makes the aircraft much closer to reality.

If someone wants to help me we to build this effect is welcome!

Here is the effect of combustion in the current output at low rpm (actually the brightness should be decreased during the day):
Image

Here you can clearly see the output cone of the turbojet and the large stovepipe that expel and the gases to the outside:
Image

I tried to use the ALS after-burner function, but the cone remains too bright, because the ALS function operates on a full volume (parallepipedo or cylinder) that I can not drill, at least so it seems.

But at this point I ask myself a question:
But is it possible to light a flame inside an airplane without the flame fleeing in the direction of relative wind, violating the classic laws of physics?
abassign
 
Posts: 791
Joined: Mon Feb 27, 2012 5:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2018.3
OS: Linux Mint 19. x

Re: Particle system for exhausted reactor gases simulation

Postby wlbragg » Wed Nov 21, 2018 4:49 pm

Doesn't the particle emitter params allow you to set wind influence off?
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4803
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: Particle system for exhausted reactor gases simulation

Postby Thorsten » Wed Nov 21, 2018 5:15 pm

The ALS method to obtain the flame operates on a volume that, for an internal chamber, is not suitable as it is a parallelepiped,


No, it operates on whatever you assign.

ALS option it should be redone for the specific case involving the flame inside the turbo-jet outlet pipe.


People have done that - it's all configurable.

But is it possible to light a flame inside an airplane without the flame fleeing in the direction of relative wind, violating the classic laws of physics?


ALS flame shader - that's basically what it's for.
Thorsten
 
Posts: 10819
Joined: Mon Nov 02, 2009 8:33 am

Re: Particle system for exhausted reactor gases simulation

Postby abassign » Wed Nov 21, 2018 6:40 pm

wlbragg wrote in Wed Nov 21, 2018 4:49 pm:Doesn't the particle emitter params allow you to set wind influence off?


Hi, I did the test, but it does not seem to take effect. The tests you see are with "wind" and "gravity" disabled. In my opinion there is actually a problem in the specific code.
I also noticed other problems that I described in the first post. I also hoped it was a wind problem .. moreover, I know that the reference system is consistent with that of the plane, so they are not particles like those of smoke and contrails that have their own life. Now in the open-gl code the link must be built, that is the particle that is a 2D object, to be moved according to the displacement of the emission point that is integral to the plane and the speed of the particle is added or subtracted to that of the aircraft. Instead it seems that the link is not there, so a trail is formed. The trail is short because the life time of the particle is small (obviously the frame rate), but you can not shorten the life time too much as the frame rate puts a lower limit. It would take a look at the code, in addition to the fact that I notice strange things with the emissive part, but this is another chapter.

Code: Select all
<PropertyList>

    <particlesystem>
        <name>flame_smoke_1</name>
       
        <offsets>
            <x-m>  0.000 </x-m>
            <y-m>  0.000 </y-m>
            <z-m>  0.000 </z-m>
            <roll-deg>    0.000 </roll-deg>
            <pitch-deg>   90.000 </pitch-deg>
            <heading-deg> 0.000 </heading-deg>
        </offsets>
       
        <texture>Pictures/smoke.png</texture>
       
        <condition>
            <greater-than>
                <property>fdm/jsbsim/systems/engine/rpm-norm</property>
                <value>0.01</value>
            </greater-than>
        </condition>
       
        <emissive>true</emissive>
        <lighting>false</lighting>
        <align>billboard</align> <!-- billboard / fixed -->
        <attach>local</attach> <!-- world / local-->
       
        <placer>
            <type>point</type> <!-- sector / segments / point -->
        </placer>

        <shooter>
            <radius-min-m>0.1</radius-min-m>
            <radius-max-m>0.15</radius-max-m>
            <theta-min-deg>4</theta-min-deg>
            <theta-max-deg>5</theta-max-deg>
            <phi-min-deg>-2</phi-min-deg>
            <phi-max-deg>2</phi-max-deg>
            <speed-mps>
                <value>10</value>
                <spread>0</spread>
            </speed-mps>
            <rotation-speed>
                <x-min-deg-sec>00</x-min-deg-sec>
                <y-min-deg-sec>00</y-min-deg-sec>
                <z-min-deg-sec>00</z-min-deg-sec>
                <x-max-deg-sec>00</x-max-deg-sec>
                <y-max-deg-sec>00</y-max-deg-sec>
                <z-max-deg-sec>00</z-max-deg-sec>
            </rotation-speed>
        </shooter>
       
        <counter>
            <particles-per-sec>
                <value>800</value>
                <spread>200</spread>
                <factor-prop>fdm/jsbsim/systems/engine/rpm-norm</factor-prop>
            </particles-per-sec>
        </counter>
       
        <particle>
            <start>
                <color>
                    <red><value>   0.63 </value></red>
                    <green><value> 0.58 </value></green>
                    <blue><value>  0.0 </value></blue>
                    <alpha><value> 0.1 </value></alpha>
                </color>
                <size>
                    <value>0.35</value>
                </size>
            </start>
           
            <end>
                <color>
                    <red><value>   0.9 </value></red>
                    <green><value> 0.2 </value></green>
                    <blue><value>  0.0 </value></blue>
                    <alpha><value> 0.0 </value></alpha>
                </color>
                <size>
                    <value>0.45</value>
                </size>
            </end>
           
            <life-sec>
                <value>0.1</value>
            </life-sec>

            <mass-kg>1</mass-kg>
            <radius-m>1</radius-m>

        </particle>
       
        <program>
            <fluid>air</fluid>         <!-- air / water -->
            <gravity>false</gravity>
            <wind>false</wind>
        </program>
       
    </particlesystem>

</PropertyList>
abassign
 
Posts: 791
Joined: Mon Feb 27, 2012 5:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2018.3
OS: Linux Mint 19. x

Re: Particle system for exhausted reactor gases simulation

Postby Thorsten » Wed Nov 21, 2018 6:43 pm

The particle system is not /our/ code, it's OSG native code, so in practical terms this amounts to 'deal with it as it is' - it seems hard to get even obvious bugs fixed on the OSG side.
Thorsten
 
Posts: 10819
Joined: Mon Nov 02, 2009 8:33 am

Re: Particle system for exhausted reactor gases simulation

Postby Hooray » Wed Nov 21, 2018 7:03 pm

It's also been repeatedly discussed on the devel list to phase out/re-implement the whole system from scratch, I believe there is a wiki article containing quotes linking back to the original topics on the devel list.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11325
Joined: Tue Mar 25, 2008 8:40 am

Re: Particle system for exhausted reactor gases simulation

Postby abassign » Wed Nov 21, 2018 9:47 pm

Thorsten wrote in Wed Nov 21, 2018 6:43 pm:The particle system is not /our/ code, it's OSG native code, so in practical terms this amounts to 'deal with it as it is' - it seems hard to get even obvious bugs fixed on the OSG side.


:cry: Unfortunately it is not a bug, I checked the OSG code, which is also very clear. What I observe, that is the formation of the tail, is an implicit property of the method! The fundamental code that defines the position of the particle is this:

From: https://github.com/openscenegraph/OpenSceneGraph/blob/master/src/osgParticle/Particle.cpp#L95

Code: Select all
 // update position
 _prev_pos = _position;
 _position += _velocity * dt;


The position is obtained by integrating the speed, so it is a local property of every single particle and has no connection with the object that generated it! If the position were explicit, I would have seen a different kind of expression, for example:

Code: Select all
_positionRelative += _velocity * dt;
_position = _posGenerator + positionRelative;


where _posgenerator is the position of the particle generator (in my case the motor), the _positionRelative is the relative position of the particle respect the generator, during its existence.
In the OSG code the particle does not have the _posGenerator property and therefore is separate from the generator. That's all ...
Honestly it would not be a problematic change, _position is used a few times and the introduction of a method for managing the generator position is simple and has a minimal algorithmic cost as it is only performed once. If _positionGenerator is not used (backward compatibility), it must be set to zero (default) there is a perfectly compatibility.

I see many advantages, in the case that I am analyzing to generate a localized flame. The flames coming out of a reactor would be much more compact... But also to make the smoke that forms in the cabin or steam in the malfunctions, currently if one tries ... he sees it disappear immediately ... But even light effects would be interesting .. I'm analyzing to make an AS20 (anti-tank missile) used in the G91-R1B that has a posterior pyrotechnic flare. The particle system would be very good (a pyrotechnic flare is made up of particles), but at present the speed due to the spreading would be dispersed and the effect would be very bad.

According to me it may propose to the group that follows OSG, it does not seem to be a complicated modification.

However, in the vessel of an ALS version of the particle (it would be magnificent), it is good to think of my note in order to be able to use it much more widely.
abassign
 
Posts: 791
Joined: Mon Feb 27, 2012 5:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2018.3
OS: Linux Mint 19. x


Return to Effects and shaders

Who is online

Users browsing this forum: Bing [Bot] and 0 guests

cron