Board index FlightGear Development Aircraft

More realistic Blackout/Redout

Questions and discussion about creating aircraft. Flight dynamics, 3d models, cockpits, systems, animation, textures.

Re: More realistic Blackout/Redout

Postby Alant » Wed Nov 23, 2016 1:32 pm

Here are some more JSBsim aircraft using accelerations/pilot-g:-
F-14B, F-15, F-35B, focker100, JA37, Lightning, Lockheed-Martin-FA-22A-Raptor, MD-11,Mig-21bis, Mirage-2000, BlkPony, SaabJ35F, T-4, T-50, tu154.

No doubt some of these (eg JA37) are not broken by this.

I will try a better search for JSBSim aircraft to see if any more turn up.

Alan
Alant
 
Posts: 904
Joined: Wed Jun 23, 2010 5:58 am
Location: Portugal
Callsign: Tarnish99
Version: from Git
OS: Windows 10

Re: More realistic Blackout/Redout

Postby Thorsten » Wed Nov 23, 2016 1:34 pm

Tested to work fine now and pushed... thanks again. I hope that fixes everything.
Thorsten
 
Posts: 10844
Joined: Mon Nov 02, 2009 8:33 am

Re: More realistic Blackout/Redout

Postby Thorsten » Wed Nov 23, 2016 1:39 pm

Just took a peek into the Lightning... Seems the author was well aware of the problem and introduced his own fix:

Code: Select all
    <pure_gain name="g load norm">
      <input>-accelerations/n-pilot-z-norm</input>
      <gain>1</gain>
      <output>/accelerations/pilot-g</output>
    </pure_gain>


Edit: And into the Tomcat - it would explicitly make a difference whether JSBSim or YaSim is running and fetch the correct property. So Richard was aware of this as well...
Last edited by Thorsten on Wed Nov 23, 2016 1:50 pm, edited 1 time in total.
Thorsten
 
Posts: 10844
Joined: Mon Nov 02, 2009 8:33 am

Re: More realistic Blackout/Redout

Postby Necolatis » Wed Nov 23, 2016 1:47 pm

The only reason JA37 refer to that property is because it has the Nasal blackout system which detects if yasim is running. So yes, its not broken.

Hmm, I guess the Lightning and maybe others best be changed before 2017.1.1 then.
"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: More realistic Blackout/Redout

Postby Thorsten » Wed Nov 23, 2016 1:56 pm

... and the F-15 has a vapour effect file from an F22 project which keys on accelerations/pilot-g - which never should have worked then?
Thorsten
 
Posts: 10844
Joined: Mon Nov 02, 2009 8:33 am

Re: More realistic Blackout/Redout

Postby Richard » Wed Nov 23, 2016 2:05 pm

Alant wrote in Wed Nov 23, 2016 1:32 pm:F-14B, F-15


These should be using /accelerations/pilot-gdamped which is updated from the JSBSim model. I see that there is one reference that isn't so I'll investigate that for a fix. This is largely due to the F-14 originally having only a yasim model, and then my changes layered ontop of that in a compatible way.
Richard
 
Posts: 700
Joined: Sun Nov 02, 2014 10:17 pm
Version: Git
OS: Win10

Re: More realistic Blackout/Redout

Postby Alant » Wed Nov 23, 2016 2:12 pm

Thorsten

Re the Lightning.

Yes, but beware, there are couple of gotchas for the unwary.

1. note the minus sign in front of accelerations/n-pilot-z-norm.
2. This code is in the JSBsim xml code and accelerations/n-pilot-z-norm is actually in the jsbsim property tree , i.e. it is /fdm/jsbsim/accelerations/n-pilot-z-norm

Alan
Alant
 
Posts: 904
Joined: Wed Jun 23, 2010 5:58 am
Location: Portugal
Callsign: Tarnish99
Version: from Git
OS: Windows 10

Re: More realistic Blackout/Redout

Postby Thorsten » Wed Nov 23, 2016 3:33 pm

Yes, but beware, there are couple of gotchas for the unwary.


Sure - my point being, the author noticed that /accelerations/pilot-g doesn't normally exist under JSBSim and fixed it as part of his systems definitions.

It's a hack, plain and simple. I'm guessing as we look more and more into aircraft, we'll see more hacks, because usually people are bound to notice that the instrument they've just created doesn't show anything. So presumably often they fixed it in an ad-hoc way.

Of course fuel systems cutting flow under some accelerations won't show up that easily.
Thorsten
 
Posts: 10844
Joined: Mon Nov 02, 2009 8:33 am

Re: More realistic Blackout/Redout

Postby Alant » Wed Nov 23, 2016 5:20 pm

I did a different JSBsim search and found these to add to the accelerations/pilot-g list:-
c150, Carreidas, Hawker-Siddeley-Nimrod, Jaguar, MirageIII, MIrageIV, T-50, victor, vulcanb2, XB-70, Zlin-501x.

Alan
Alant
 
Posts: 904
Joined: Wed Jun 23, 2010 5:58 am
Location: Portugal
Callsign: Tarnish99
Version: from Git
OS: Windows 10

Re: More realistic Blackout/Redout

Postby Johan G » Wed Nov 23, 2016 5:42 pm

It might be a good idea to add a sticky in the aircraft development subforum and in the newsletter about these g-force properties. ;)
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)
Johan G
Moderator
 
Posts: 5490
Joined: Fri Aug 06, 2010 5:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 3.0.0
OS: Windows 7, 32 bit

Re: More realistic Blackout/Redout

Postby Thorsten » Thu Nov 24, 2016 7:07 am

Just checked out the Valkyrie - so here it seems we ended up fixing a broken accelerometer by updating the property.
Thorsten
 
Posts: 10844
Joined: Mon Nov 02, 2009 8:33 am

Re: More realistic Blackout/Redout

Postby Thorsten » Tue Nov 29, 2016 8:09 am

Okay, this got somewhat derailed by unforseen complications, but since I have the impression we're back on track... If you want to experiment with a simple test-bed for a shader based solution please open

Shaders/filters-ALS.frag

and insert the following function

Code: Select all
vec3 g_force (in vec3 color) {

vec2 center = vec2 (float(display_xsize) * 0.5, float(display_ysize) * 0.5);

float greyout_band_width = 0.2;
float blackout_band_width = 0.3;

float greyout = smoothstep( brightness * display_ysize, (brightness + greyout_band_width) * display_ysize, length(gl_FragCoord.xy -center));

float tgt_brightness = (1.0 - 0.3 * greyout);

color = mix(color, vec3 (1.0, 1.0, 1.0) * mix(length(color), tgt_brightness, greyout) , greyout);
color *= (1.0 - 0.3 * greyout);

float blackout = 1.0 - smoothstep( gamma * display_ysize, (gamma + blackout_band_width) * display_ysize, length(gl_FragCoord.xy -center));

color *= blackout;

return color;

}


above vec3 filter_combined (in vec3 color) {


and then modify the start of the latter function by inserting a call to g_force

Code: Select all
vec3 filter_combined (in vec3 color) {

return g_force(color);

if (use_filtering == false)
   {
   return color;
   }
...


This disables the normal functioning of the filters and allows you to drive the blackout and greyout terminators via

/sim/rendering/als-filters/brightness
/sim/rendering/als-filters/gamma

(the defaults will of course be wrong so you'll see strong effects on the runway at startup unless you drive these to reasonable values - it's just a setup for you to play with and give feedback for refinement).
Thorsten
 
Posts: 10844
Joined: Mon Nov 02, 2009 8:33 am

Re: More realistic Blackout/Redout

Postby Necolatis » Tue Nov 29, 2016 2:45 pm

Awesome!

I am guessing you are aware of that the sky is only semi-affected. But I can still get a good idea of how it will look. :)

The greyout is very strong, in my opinion it could maybe be more subtle. When flying I cannot make out terrain contours through it, only cockpit contours stand out. But that's just my opinion.

But overall, I like it, and the range of the 2 parameters works for me.

Image
"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: More realistic Blackout/Redout

Postby Thorsten » Tue Nov 29, 2016 3:17 pm

I am guessing you are aware of that the sky is only semi-affected.


Anything that's not in the effect framework remains unimpressed - that includes the old 2d clouds (they also get the wrong light in ALS). My idea would be to use the shader in combination with the standard full-screen blackout/redout, but delay the standard technique some so that you first see shrinking circular regions while gradually everything starts to blank as well.

I can try for a more gradual greyout if you prefer that, should not be dramatically complicated. Also, I can probably add some noise to the center region.
Thorsten
 
Posts: 10844
Joined: Mon Nov 02, 2009 8:33 am

Re: More realistic Blackout/Redout

Postby Necolatis » Tue Nov 29, 2016 3:24 pm

Thorsten wrote in Tue Nov 29, 2016 3:17 pm:
My idea would be to use the shader in combination with the standard full-screen blackout/redout, but delay the standard technique some so that you first see shrinking circular regions while gradually everything starts to blank as well.


Yes, is also the idea I have been toying with in my head.

Thorsten wrote in Tue Nov 29, 2016 3:17 pm:I can try for a more gradual greyout if you prefer that, should not be dramatically complicated. Also, I can probably add some noise to the center region.


Cool.

Now the greyout filter is in effect even if filters is not enabled, do you plan to keep it like that? (I hope so).
"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

PreviousNext

Return to Aircraft

Who is online

Users browsing this forum: No registered users and 13 guests