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 Thorsten » Tue Nov 29, 2016 4:43 pm

I guess I would run the filter unconditionally, but it would not do anything unless blackout simulation actually drives the terminator radii.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: More realistic Blackout/Redout

Postby Thorsten » Fri Dec 02, 2016 2:58 pm

Try running this filter:

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.5 * greyout);

float noise = Noise2D( vec2 (gl_FragCoord.x + 100.0 * osg_SimulationTime, gl_FragCoord.y + 300.0 * osg_SimulationTime), 8.0);

noise *= (1.0 - smoothstep(0.0, 0.5, gamma));

color = mix(color, vec3 (1.0, 1.0, 1.0) * mix(length(color), tgt_brightness, greyout)  , 0.9* greyout + 0.6 * noise);
color *= tgt_brightness;

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

color *= blackout;

return color;

}


It has a less agressive greyout so that the outlines are preserved, it tones down the grey value a little more and it starts adding noise to the center of the FOV once the blackout radius parameter goes below 0.5.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: More realistic Blackout/Redout

Postby Necolatis » Fri Dec 02, 2016 5:34 pm

Indeed very nice. Really like the noise.
"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 » Fri Dec 02, 2016 6:46 pm

Please try playing with the grain size of it and the onset - ideally I'd like to see the thing perfected and then push it in one go (it'll require lots of maintenance in many effects).
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: More realistic Blackout/Redout

Postby Hooray » Sat Dec 03, 2016 5:32 pm

I really have no experience with making pretty PUI dialogs (only made an ugly simple one), but if you want me to modify the dialog, I can try.


Depending on the widgets you are using, a simple solution might be creating a corresponding Canvas GUI dialog (e.g. using buttons, checkboxes, input fields):
Image

Alternatively, the pui2canvas parser is able to process a subset of PUI/XML dialogs without having to touch any dialogs at all:
http://wiki.flightgear.org/Howto:Proces ... ing_Canvas
Image
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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: More realistic Blackout/Redout

Postby D-ECHO » Sun Dec 04, 2016 8:00 pm

Honestly, IMO the "old style" dialog looks better here... so if it's for being more pretty...
D-ECHO
 
Posts: 2460
Joined: Sat May 09, 2015 1:31 pm
Pronouns: Bea (she/her)
Version: next

Re: More realistic Blackout/Redout

Postby Thorsten » Mon Dec 05, 2016 7:23 am

That's not the point - the point is that it can parse PUI xml and make a viable dialog composed of canvas elements out of it. Any graphics artist can now make better elements, changing colors and fonts is down to a .setColor() or .setFont(), so the whole thing is as configurable as any canvas element.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: More realistic Blackout/Redout

Postby Necolatis » Mon Dec 05, 2016 8:49 pm

So far I think we settled on not expanding the GUI, also it could be confusing to users to have 10 parameters to fiddle with. Those details is really something the plane maker should set IMO. When the filters have been added and redout been updated to use them, I will write documentation on how to set them.

I like the size of the grains in the middle, and I like when they onset.
"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 Necolatis » Mon Dec 05, 2016 9:29 pm

Another thing.

Canvas HUD does not seem to be affected by the black either. At least not when this is done to it:

Code: Select all
<effect>
        <inherits-from>Effects/model-transparent</inherits-from>
        <object-name>CanvasHUD</object-name>
    </effect>


And I think that has to be done to it, since to my knowledge its the only way to get outside rain/snow plus windshield effects (frost,rain, fog) visible through the HUD, correct? (at least I could not figure out how to do it with Effects/model-combined-transparent)
"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 Dec 06, 2016 8:02 am

Using model-transparent.eff explicitly requests a fixed-pipeline function without any shader and hence opts out of ALS - so no surprise shader magic doesn't work.

(at least I could not figure out how to do it with Effects/model-combined-transparent)


Why does this not work? Theoretically it should be the clean way to do it (also assigning glass.eff to the HUD should give you fine ALS behavior and select the same as model-transparent.eff for the other renderers).
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: More realistic Blackout/Redout

Postby Necolatis » Thu Jan 12, 2017 2:47 pm

glass.eff actually works, yes, thank you. model-combined-transparent.eff I could not get to work, and it also displays the canvas background fill differently when switching model shader off.


I like the size of the grains in the middle, and I like when they onset.


With this comment I actually meant to say that I think that your shaders are perfect as they are, and for my sake they can go in like that. There has not been any activity in this thread so I was not sure if I had expressed myself clear on this.

I have given them some second thought though and I have had a change of mind. Since many planes will have details that is not rendered correctly with your shaders, people might not always want the greyout and tunnel vision to be forced active when ALS is on. Maybe ALS-filters should be activated like for the other filters before they come into effect?

Anyhow, when they are ready or when I have the properties names that should be manipulated, I will update the g-forces.xml. (cannot be before late next week though, after I have replaced my HD [S.M.A.R.T. is saying my current is under under imminent risk of failure. :(])
"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 » Thu Jan 12, 2017 3:04 pm

Unless some else volunteers to do the repository work, it might have to wait a little longer now - I'm in the process of getting a new computer and won't bother to fiddle with the required package updates to accomodate all recent changes on my current one to compile next, so I can't currently pull a matching FGData, test changes and push, I'd have to work blind, and the breakage potential for fiddling with all effects is just too high.

Once the new machine is acquired, up and running I can get back to this.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: More realistic Blackout/Redout

Postby Necolatis » Thu Jan 12, 2017 3:15 pm

Alright.
"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 » Fri Jan 13, 2017 5:08 pm

You can go ahead - Richard offered to do the job.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: More realistic Blackout/Redout

Postby adam_one » Sat Jan 14, 2017 2:15 am

I love fainting. Just a coincidence that I'm on a flightsim-forum.
But sleeping at the stick is on my wishlist.
adam_one
 
Posts: 64
Joined: Tue Jan 05, 2016 3:41 pm
Version: alpha
OS: pirated

PreviousNext

Return to Aircraft

Who is online

Users browsing this forum: No registered users and 13 guests