Board index FlightGear Development Effects and shaders

ALS landing lights

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

Re: ALS landing lights

Postby hvengel » Sat Dec 13, 2014 8:55 pm

I do agree with you about the general priority of how to use the available rendering bandwidth. Although with my hardware all of this matters very little since I have the rendering bandwidth to handle just about anything. But we do need to limit how many features we implement that bake in a rendering cost that affects everyone regardless of which aircraft they are running or what level of eye candy they have set. Particularly since this type of thing seems to have a larger overall affect on users with lower end hardware. So I don't have an issue with the ALS lights not working in a usable way with tail draggers if fixing the issues will have an overall frame rate impact.

Too bad really since landing lights would be very useful for night operations but at least some aircraft will now have the ability to add landing lights with minimal frame rate impact. So it is a step forward even if it does not work for my aircraft.

By the way tested the /sim/current-view/ stuff and it was working as expected (IE. that values changed as I panned the view around or adjusted the zoom level).
hvengel
Retired
 
Posts: 1127
Joined: Sun Dec 24, 2006 5:35 am
Location: Minden Nevada

Re: ALS landing lights

Postby hvengel » Sat Dec 13, 2014 8:59 pm

Also about the SVN vs GIT thing I have a similar issue since I sometimes work on stuff in Aricraft/Instruments-3D. So I also need to have both fgdata/GIT and fgaddon/SVN.
hvengel
Retired
 
Posts: 1127
Joined: Sun Dec 24, 2006 5:35 am
Location: Minden Nevada

Re: ALS landing lights

Postby Gijs » Sat Dec 13, 2014 9:13 pm

After the 3.4 release, all aircraft that are now on SVN (non-base package aircraft) will be removed from fgdata.
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9544
Joined: Tue Jul 03, 2007 3:55 pm
Location: Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: ALS landing lights

Postby hvengel » Sat Dec 13, 2014 9:30 pm

But Instruments-3D is part of the base package is it not? Wait I think your point is that Thorsten would not have been confused about which aircraft (GIT vs. SVN) was the current up to date version if we were not in a transition period.
hvengel
Retired
 
Posts: 1127
Joined: Sun Dec 24, 2006 5:35 am
Location: Minden Nevada

Re: ALS landing lights

Postby Thorsten » Sun Dec 14, 2014 8:34 am

After the 3.4 release, all aircraft that are now on SVN (non-base package aircraft) will be removed from fgdata.


I'm not confused about where to get the latest version - it's a question of threshold. Let's take the case at hand. I get a report about problems with a specific aircraft, so the natural thing to do is take a quick look myself. I actually don't want necessarily the latest version here, I just want a working version to see where the view points.

For aircraft part of FGData, all it takes for me is to fire up FG and see. But with aircraft moved out, I'd now need to download and install the SVN package. Now, it's a weekend and I'm at home with a GSM modem connection, the P-51D is a substantial resource hog on GIT with 1.1 GB (not sure if it's much smaller on SVN), at good days I get 100 kbit/sec over the GSM, but today is heavy snowfall so I expect perhaps 15 kbit/sec, so the threshold changed from suddenly changed from just trying to a few hours download.

Which probably means I won't automatically test whether things work with aircraft which aren't in the base package in the future unless I happen to like them and have them installed anyway - there's just too much overhead to manage yet another repo.

By the way tested the /sim/current-view/ stuff and it was working as expected (IE. that values changed as I panned the view around or adjusted the zoom level).


So you see the properties change, but you don't see the light remain where it should be?? I'm royally confused.

What happens if you change


Code: Select all
<view_pitch_offset><use>/sim/current-view/pitch-offset-deg</use></view_pitch_offset>
in Effects/terrain-default.eff into

Code: Select all
 <view_pitch_offset>20.0</view_pitch_offset>


(the landing light lightspots should be displaced from the searchlight - in other words, is the problem reading the property, or is it passing its value through to the shader).

Too bad really since landing lights would be very useful for night operations but at least some aircraft will now have the ability to add landing lights with minimal frame rate impact. So it is a step forward even if it does not work for my aircraft.


Admittedly I still fail to see why. If I can't see the runway during approach, it's sort of irrelevant whether it is illuminated or not. And if I can see it, it's somewhere in the lower half of the screen - and the landing light is designed to be somewhere in the lower half of the screen.

So even if your default view is pointed to the sky for a normal approach for whatever reason, you might still easily define a dedicated landing view where the view axis is just where it needs to be to see the runway in the lower half of the screen.

Only a case where you need the upper half of the screen illuminated would be a bit tricky to handle - but I doubt any plane does that.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: ALS landing lights

Postby Bjoern » Sun Dec 14, 2014 5:48 pm

Gijs wrote in Sat Dec 13, 2014 9:13 pm:After the 3.4 release, all aircraft that are now on SVN (non-base package aircraft) will be removed from fgdata.


You mean GIT, right?

If so: Hooray, finally! No more downloading massive amounts of "dead" data!
Bjoern
 
Posts: 484
Joined: Fri Jan 06, 2012 11:00 pm
Location: TXL (RIP)
Version: Next
OS: ArchLinux

Re: ALS landing lights

Postby hvengel » Mon Dec 15, 2014 12:06 am

The landing lights move as I pan the pilots view either side to side or up and down. The search light stays pretty centered in the pilots view but the landing light is positioned above the search light. Seems backwards to me but the lights are displaced with the landing light above the search light.

I tried the change to Effect/terrain-default.eff and changing that to a constant did off set the light considerably. But it still moves up and down and side to side when I pan the pilots view. Shouldn't the pitch offset be relative to the aircraft x axis + the pilots eyes offset from z = 0 axis?

"If I can't see the runway during approach..."

I can see the runway (mostly) during most of the approach even over the nose. I can't see the runway straight ahead during the landing flare or while on the ground which is what matters here. I can see the runway looking to the side through the side windshields during the flare and when on the ground.

Pilots are trained to look to the side (about 30 degrees) at the edge of the runway leading up to and during the flare to make judging how far they are above the runway easier (if you look straight ahead most of your visual height clues are gone IRL). This is the case even for GA aircraft with good forward visibility during landing but is required for aircraft that completely block the forward view when flaring like the P-51D. IRL the landing light illuminates the runway starting just in front of the left wing leading edge going forward (the landing light is located at the rear edge of the left wheel well just outboard of the outer edge of the inner door). The landing light beam width is fairly wide. The illuminated area corresponds almost exactly with the runway area that I look at during the flare even in day light conditions.

"And if I can see it, it's somewhere in the lower half of the screen - and the landing light is designed to be somewhere in the lower half of the screen."

It may be designed to be in the lower half of the screen but with the P-51D using my normal view (-15.5 degrees) the landing light is pointed above the horizon, but by how much I am not sure, when I am on the ground (alpha is around 14 degrees). I have to pan the view down (remember the landing lights are moving when I pan my view) perhaps another 10 degrees to point the landing light at the horizon. At that point I can see the rudder pedals and part of the cockpit floor in my view (so I am looking down by about 30 degrees). Also on approach I can see the runway lights and I don't need the landing light's illumination (in fact you would need a extremely powerful landing light for it to be useful during most of the approach). The landing light illumination becomes useful as I am getting close enough to the runway to be preparing for the start of the flare. This may not be how landing lights are use on jetliners but this is how older aircraft equipped with sealed beam landing lights (this includes most GA aircraft) use these.

This view I am using is defined as:

Code: Select all
  <view n="0">
   <internal archive="y">true</internal>
   <config>
    <x-offset-m archive="y" type="double">0.0</x-offset-m>
    <y-offset-m archive="y" type="double">0.675</y-offset-m>
    <z-offset-m archive="y" type="double">3.28972</z-offset-m>
    <pitch-offset-deg>-15.5</pitch-offset-deg>
   </config>
  </view>


And I default the view width to 80 degrees via fgrun. On a 16x10 display this places the top of the windshield bow at the top of the screen and shows almost the full panel. The sides of the windshield bow are right at the sides of the screen on both sides. On a large display this is a very good approx. of what a pilot would see looking straight ahead. With this setup the horizon is generally very close to the center of the screen when on the ground and when in the air it is slightly above the center of the screen.

Just did an interesting experiment. I put the P-51D up on it's jack stands which makes the x axis parallel to the ground and puts it into an attitude similar to a trike. At that point the landing light is pointed at the runway in front of the aircraft just like in your screen shots of a machine that is apparently a trike. Of course this is an attitude that will not happen IRL when being operated on the ground or in the last phases of a landing.

Did another test with the Cub. It has the same basic issues. So the landing light being pointed up above the horizon appears to be a general issue with tail draggers. I also tried the P-47 - same issue.

Again if fixing this will cause a generalized frame rate hit, even a small one, then please do not fix it.
hvengel
Retired
 
Posts: 1127
Joined: Sun Dec 24, 2006 5:35 am
Location: Minden Nevada

Re: ALS landing lights

Postby hvengel » Mon Dec 15, 2014 12:22 am

Bjoern,

All non-core aircraft are now in an SVN repository (so all but 5 or so aircraft and some shared stuff like Instruments-3D). Soon these will be removed from fgdata so fgdata will get much smaller (not sure how much smaller but 70% to 80% is probably an underestimate). Most aircraft devs have switched to the SVN repo and are working there now. With SVN you can download individual aircraft which in the long run will benefit both users and aircraft devs since user testing of specific aircraft will be much easier for users. This should result in better feedback for the aircraft devs so that issues are found earlier in the development/release cycle making it more likely that these will be fixed before the next release.
hvengel
Retired
 
Posts: 1127
Joined: Sun Dec 24, 2006 5:35 am
Location: Minden Nevada

Re: ALS landing lights

Postby Bjoern » Mon Dec 15, 2014 2:47 pm

hvengel wrote in Mon Dec 15, 2014 12:22 am:All non-core aircraft are now in an SVN repository (so all but 5 or so aircraft and some shared stuff like Instruments-3D). Soon these will be removed from fgdata so fgdata will get much smaller (not sure how much smaller but 70% to 80% is probably an underestimate). Most aircraft devs have switched to the SVN repo and are working there now. With SVN you can download individual aircraft which in the long run will benefit both users and aircraft devs since user testing of specific aircraft will be much easier for users. This should result in better feedback for the aircraft devs so that issues are found earlier in the development/release cycle making it more likely that these will be fixed before the next release.


Thank you so much for doing this, guys!
I find the hard drive space is better invested in scenery than in unused aircraft.
Bjoern
 
Posts: 484
Joined: Fri Jan 06, 2012 11:00 pm
Location: TXL (RIP)
Version: Next
OS: ArchLinux

Re: ALS landing lights

Postby Thorsten » Mon Dec 15, 2014 6:26 pm

The landing lights move as I pan the pilots view either side to side or up and down. The search light stays pretty centered in the pilots view but the landing light is positioned above the search light. Seems backwards to me but the lights are displaced with the landing light above the search light.


Code: Select all
vec3 searchlight()
{

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

float headlightIntensity; 
float lightRadius = (float(display_xsize) *9.16 /field_of_view);
float angularDist = length(gl_FragCoord.xy -center);

if (angularDist < lightRadius)
   {
   headlightIntensity = pow(cos(angularDist/lightRadius * 1.57075),2.0);
   //headlightIntensity = headlightIntensity *
   //headlightIntensity*= clamp(1.0 + 0.15 * log(1000.0/(dist*dist)),0.0,1.0);
   return  headlightIntensity * vec3 (0.5,0.5, 0.5);
   }
else return vec3 (0.0,0.0,0.0);
}


Code: Select all
vec3 landing_light(in float offset)
{

float fov_h = field_of_view;
float fov_v = float(display_ysize)/float(display_xsize) * field_of_view;

float yaw_offset;

if (view_heading_offset > 180.0)
   {yaw_offset = -360.0+view_heading_offset;}
else
   {yaw_offset = view_heading_offset;}

float x_offset = (float(display_xsize) / fov_h * (yaw_offset + offset));
float y_offset = -(float(display_ysize) / fov_v * view_pitch_offset);

vec2 center = vec2 (float(display_xsize) * 0.5 + x_offset, float(display_ysize) * 0.4 + y_offset);



float landingLightIntensity; 
float lightRadius = (float(display_xsize) *9.16 /field_of_view);
float angularDist = length(gl_FragCoord.xy -center);

if (angularDist < lightRadius)
   {
   landingLightIntensity = pow(cos(angularDist/lightRadius * 1.57075),2.0);
   //landingLightIntensity *= min(1.0, 10000.0/(dist*dist));
   return  landingLightIntensity * vec3 (0.5,0.5, 0.5);
   }
else return vec3 (0.0,0.0,0.0);
}



I'm tempted to say that's impossible. If the offsets are zero, the code generating the lights is identical (see above) - the center of the light spot is placed at (0.5 * hsize, 0.4 * vsize) in screen coordinates. All the landing light code does is to offset the spot if the view offsets are non-zero and to account for the user-specified displacements.

I'm sorry, but I can't even begin to guess what's happening on your end - I can conceive of the landing light not getting the properties and following the searchlight, but I can't see how the view offset parameters change as you pan view, the landing light moves with the view but is not identical to the searchlight - somehow the view offset parameters would have to be passed as constant values for that to happen (?), but you see the relevant parameters changing?!

Since I can't reproduce that and no other user so far has reported anything similar, I have to conclude it's some weirdness of your setup, but I don't have a good theory what it could be.

I tried the change to Effect/terrain-default.eff and changing that to a constant did off set the light considerably. But it still moves up and down and side to side when I pan the pilots view. Shouldn't the pitch offset be relative to the aircraft x axis + the pilots eyes offset from z = 0 axis?


Well, not if you insert a constant - then you place the light onto a constant screen position.

So the landing light being pointed up above the horizon appears to be a general issue with tail draggers.


The landing light is pointed downward to whatever you happen to define as your view axis. If you define your default view axis as pointing towards the horizon when the taildragger is on the ground and has the nose high up rather than along the nose, the light will point down from there. It's really screen coordinate arithmetics using the view offset parameters, so you have in principle full control where you point it by setting the default view axis.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: ALS landing lights

Postby hvengel » Mon Dec 15, 2014 8:57 pm

"The landing light is pointed downward to whatever you happen to define as your view axis"

OK that explains a lot. I thought that the landing light was actually like a IRL landing light where the light always pointed in the same direction relative to the aircraft. But you are saying it points in a direction that is relative to the view axis. So in that case I would expect the light to move around as I pan the pilots view (axis). Which is exactly what I am seeing.

Changing from a trike to a tail dragger has a drastic affect on where the landing light spot appears with the spot being hidden behind the nose of the aircraft but still pointed above the horizon. Please have a look at the Cub as this is not unique to the P-51D.

Here is an image that shows the landing light and the search light with the pilot looking down the wing of the P-51D. The light that is illuminating the star is the landing light and the light illuminating the gas filler cover is the search light. As you can see the landing light is pointed higher than the search light. Also notice that the landing-light*-offset-deg = 0 but the landing light is pointed about 90 degrees to the left of the x axis.

Image

I used that latest snap shot from the Jenkins server as well as the latest fgdata.
hvengel
Retired
 
Posts: 1127
Joined: Sun Dec 24, 2006 5:35 am
Location: Minden Nevada

Re: ALS landing lights

Postby Thorsten » Tue Dec 16, 2014 7:37 am

OK that explains a lot. I thought that the landing light was actually like a IRL landing light where the light always pointed in the same direction relative to the aircraft.But you are saying it points in a direction that is relative to the view axis.


Yes, but the view axis doesn't change when you pan - it's a constant characteristic for the chosen view, i.e. it's (usually) fixed with respect to the aircraft (not in flyby mode obviously...) . Cockpit view has a view axis, model view has a different one,... The point is that FG defines a default view axis and, as you pan, offsets.

So you can use the default view axis to point the light up or down, it's not really tied to the model axis like a real landing light would, it's tied to a non-physical property in the simulation. If you change the default view axis definition of cockpit view, the model looks the same and still you can look around everywhere.

Here's how it looks with the Cub for me - the landing light points upward (I used a lot of fog, since the lights illuminate fog, that makes the lightspot visible) and doesn't follow the pan, the searchlight follows as I look to the left and down of the default view axis.

Image

Here is an image that shows the landing light and the search light with the pilot looking down the wing of the P-51D.


Again, that really shouldn't be possible at all since there's a range check in the code (the lights aren't supposed to illuminate the panel...)
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: ALS landing lights

Postby hvengel » Tue Dec 16, 2014 7:51 pm

So with the Cub you confirmed that the landing light is pointed above the horizon just like it is with the P-51D. From your screen shot it appears to be pointed higher than the spot light. I just tried the Cub and on my system it behaves just like the P-51D.

I guess I am confused about what the view axis is. I did a grep of the FGData/Docs directory for "view axis" and only found one reference in README_local_weather.html which read "...but rapid change of the view axis (looking around)...". This agrees with what I thought the view axis was but this does not correspond to what you are writing. I did a bunch of google searches for flightgear + "view axis" and did not find anything very useful.

At this point I am almost ready to give up. What I am seeing is apparently significantly different from what you are seeing so there appears to be a difference someplace in the software or configuration. Even if we figured out the software/configuration difference it looks like the landing lights in their current form can not be configured to work with tail draggers (since the lights point above the horizon). In addition it is apparently impossible for things to work the way they do on my machine so this is an added complication. After all how do you correct a problem that can't happen.
hvengel
Retired
 
Posts: 1127
Joined: Sun Dec 24, 2006 5:35 am
Location: Minden Nevada

Re: ALS landing lights

Postby Johan G » Tue Dec 16, 2014 8:19 pm

About the "view axis", have a look in data/Nasal/view.nas. I think the properties (re)set by resetViewPos and resetViewDir defines the view axis (link to view.nas lines 67-87):

  • /sim/current-view/x-offset-m
  • /sim/current-view/y-offset-m
  • /sim/current-view/z-offset-m

  • /sim/current-view/heading-offset-deg
  • /sim/current-view/pitch-offset-deg
  • /sim/current-view/roll-offset-deg
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: ALS landing lights

Postby Thorsten » Wed Dec 17, 2014 9:09 am

So with the Cub you confirmed that the landing light is pointed above the horizon just like it is with the P-51D.


No surprise here, I've been agreeing all the time that this would happen.

From your screen shot it appears to be pointed higher than the spot light.


I can point the searchlight anywhere I want - if I look up, it gets higher than the landing light :-)

I guess I am confused about what the view axis is.


'The point is that FG defines a default view axis and, as you pan, offsets.' - look into /sim/current-view and see how the properties change as you pan - if the offsets are zero, you're on the default axis.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

PreviousNext

Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 12 guests