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 2: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: 1219
Joined: Wed Jun 23, 2010 6:58 am
Location: Portugal
Callsign: Tarnish99
Version: latest Git
OS: Windows 10/11

Re: More realistic Blackout/Redout

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

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

Re: More realistic Blackout/Redout

Postby Thorsten » Wed Nov 23, 2016 2: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 2:50 pm, edited 1 time in total.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: More realistic Blackout/Redout

Postby Necolatis » Wed Nov 23, 2016 2: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
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: More realistic Blackout/Redout

Postby Thorsten » Wed Nov 23, 2016 2: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: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: More realistic Blackout/Redout

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

Alant wrote in Wed Nov 23, 2016 2: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: 810
Joined: Sun Nov 02, 2014 11:17 pm
Version: Git
OS: Win10

Re: More realistic Blackout/Redout

Postby Alant » Wed Nov 23, 2016 3: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: 1219
Joined: Wed Jun 23, 2010 6:58 am
Location: Portugal
Callsign: Tarnish99
Version: latest Git
OS: Windows 10/11

Re: More realistic Blackout/Redout

Postby Thorsten » Wed Nov 23, 2016 4: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: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: More realistic Blackout/Redout

Postby Alant » Wed Nov 23, 2016 6: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: 1219
Joined: Wed Jun 23, 2010 6:58 am
Location: Portugal
Callsign: Tarnish99
Version: latest Git
OS: Windows 10/11

Re: More realistic Blackout/Redout

Postby Johan G » Wed Nov 23, 2016 6: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)
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: More realistic Blackout/Redout

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

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

Re: More realistic Blackout/Redout

Postby Thorsten » Tue Nov 29, 2016 9: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: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: More realistic Blackout/Redout

Postby Necolatis » Tue Nov 29, 2016 3: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
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: More realistic Blackout/Redout

Postby Thorsten » Tue Nov 29, 2016 4: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: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: More realistic Blackout/Redout

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

Thorsten wrote in Tue Nov 29, 2016 4: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 4: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
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

PreviousNext

Return to Aircraft

Who is online

Users browsing this forum: No registered users and 15 guests