Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Night illumination for the panel #438

Closed
gilbertohasnofb opened this issue Aug 1, 2015 · 442 comments
Closed

Night illumination for the panel #438

gilbertohasnofb opened this issue Aug 1, 2015 · 442 comments

Comments

@gilbertohasnofb
Copy link
Member

Currently we have the amazing ALS flashlight in our plane, but what if also added some floodlight to the cockpit? How common is it in this type of model? Maybe @tigert or @Juanvvc know about it.

We could implement it via a lightmap that would be created for each individual panel (and interiors as well if necessary). The effect would be something like this (but maybe darker):

image

The image above is from an FSX product, but here is how a lightmap looks in FG:

image2

So what do you all think about this? I'd be happy to create the textures myself.

@gilbertohasnofb gilbertohasnofb added this to the FlightGear 3.8 feature freeze milestone Aug 1, 2015
@Juanvvc
Copy link
Collaborator

Juanvvc commented Aug 1, 2015

In the JAA/EASA countries (ie, Europe), night operations under VFR (VFRN) are a pain in the ass. The normal pilot license is not enough. You need a special license, an aircraft certified for IFR, an authorization from the local authorities (revised monthly) and many nearby airports prepared for VFRN: your origin, your destination and all the alternate airports. Old c172 are usually not certified for IFRs, even if they have the instruments: maintaining the certification for the aircraft is too expensive. In Spain, airports are usually not prepared for VFRN: the authorities are not very supportive of VFR operations in large airports and much less VFRN operations, and preparing private airports for VFRN is insanely expensive. As a result, VFRN operations in Spain are extremely rare. I honestly have no idea about the cabin lights on a real c172, even if I have booked more than 50 hours in one of them. My only landing experience at night was in a Piper PA28 and I was a passenger (I was the pilot in command until the nightfall)

This is much easier in the FAA countries.

@gilbertohasnofb
Copy link
Member Author

@Juanvvc Thanks for all the info, I think you had mentioned before all the trouble about VFRN in Europe. But isn't the 172 P also certified for IFR flights? If so, then night flying should be possible, right?

@gilbertohasnofb
Copy link
Member Author

For instance, these guys have two 172 model P certified for IFR: http://ifrsolutions.com/aircraft/

@Juanvvc
Copy link
Collaborator

Juanvvc commented Aug 1, 2015

Most c172 have the instruments, but they are usually not certified for IFR. For example, the VORs must be accurately calibrated and this is expensive. Cessna has already increased the official maintenance old c172 need to be flyable (specially regarding rust), and many operators of old c172 decided they are not paying the extra costs of an IFR certification for old instruments. Notice all the aircraft in your link use glass cockpits.

My flight club sold "my" c172 because the extra maintenance required by Cessna was very expensive. Imagine an IFR certification! In any case, IFR certification for the aircraft is not really needed for VFRN. Apparently, having the instruments is enough...

In any case, IFR in a small aircraft is very uncommon, at least in Spain. Too much trouble to get anywhere under IFR if you use a small, slow aircraft. Pilots under IFR in small aircraft are usually training to be commercial pilots, and they are usually clever enough to fly a two-engine aircraft. In this case, they can book hours both under the IFR and two-engine columns :)

@gilbertohasnofb
Copy link
Member Author

Thanks for all the information Juan, I understand all your points. Just a small comment though:

Notice all the aircraft in your link use glass cockpits.

Are you sure? I don't seem to find a mention of glass cockpit for the second aircraft in that link which is a P model.

Anyway, let's change the focus of the question then: in your opinion, should we implement some sort of night illumination to the cockpit beyond the flashlight or not?

@wkitty42
Copy link
Contributor

wkitty42 commented Aug 2, 2015

when the work on the flashlight came into being, we had also discussed about a done light in the overhead... there was also mention of a light on the rear door post of the pilots doorway that shone on the panel...

@gilbertohasnofb
Copy link
Member Author

@wkitty42 Yes, we discussed that but it would have involved another ALS light. I am proposing an easier and probably less expensive solution of using a lightmap on the panel when the dome light is on.

@tigert
Copy link
Contributor

tigert commented Aug 3, 2015

What we have in the c172p-detailed is definitely valid for night VFR also in Europe.

I do have a night rating, which I did at the same time as my PPL, though I do not really have much night flying hours logged. This was before EASA, nowadays night rating (NF) is mandated to be a separate training course in EASA, and perhaps rightfully so, as night flying does involve many risks and pitfalls you don't have when flying in daylight. But it is more common here, as our days are so much shorter during winter.

Nevertheless our trusty old FlightGear C172 has what it takes to get flying in the night: navigational lights, pitot heat, more or less IFR avionics with two VORS, DME and an ADF, even artificial horizon and directional gyro, so it is totally doable.

In more densely populated areas it is not really that big of a deal as the ground is pretty much lit with street lights and houses, but this does change quite dramatically when you fly cross-country at night: https://www.youtube.com/watch?v=MTTenj5jSaU

Nowadays there's GPS but before that, and also now as a backup, in case it fails, you fly VOR radials, and follow bigger roads that are lit, to find your way around.

The 172 has a red floodlight in the roof panel pointing at the panel, so it is more or less like that flashlight except that it does not move with your head - and it is dimmable. There is also sometimes a small map light on the left window post that has a "spotlight" cone and the switch is on the left window post as well.

Lights in OH-CTL

Roof

http://tigert.1g.fi/kuvat/Simulators/Flightgear/C172-dimensions/abk.jpg

  • Red floodlight in the roof - a hole visible in the lower beige panel. This is dimmable via the rotating knob in the lower instrument panel. That thing actually has two concentric knobs - one adjusts the internal lights of instruments and avionics, and the other sets this red floodlight intensity. Looking at the shape of the light opening hole, you can see it has roughly a mask that follows the shape of the instrument panel and the center pedestal.
  • White roof light - like on your car, you don't really use this much in flight as you want to preserve your night vision. This is more like to lit the cabin when you enter and exit the plane and such - but of course you can turn it on in flight too. It has the sldier switch as in the above photo, and the light is that white plexiglass panel.

http://tigert.1g.fi/kuvat/Simulators/Flightgear/C172-dimensions/aaz.jpg

  • Map light - that black cone-shaped spotlight on the window post, you can also see the slider switch on the on the very bottom left corner of the photo above. This has a ball-joint so you can slightly adjust the position of the light spot. I think the switch has 3 positions - RED - OFF - WHITE, but I have so little night time on CTL that I don't really remember right now.

In any case, I think we need the dimmable red spotlight. That is what makes the labels of switches and breakers and such visible at night (since there is no backlighting on the 172 panels) - the map light is kind of weird since you don't really have a 3D map on your lap in the sim cockpit anyway, and the cockpit white light is also a bit strange since if you need to fly at night in the sim, you likely should fly in a dark room and have a red-lensed flashlight at hand to look at your map with.

@tigert
Copy link
Contributor

tigert commented Aug 3, 2015

Newer 172s have flood light strips on the undersurface of the glareshield, which lit the panel (adjustable) and a special map light built in to the left yoke handle.

This is OH-SRH, a 2000'ish C172SP, with the new panel and lights: https://www.youtube.com/watch?v=MTTenj5jSaU - we have the floodlight off to see better to the outside - you want to maximize your night vision when flying VFR in darkness, to spot other traffic and landmarks. Also https://www.youtube.com/watch?v=N2ZB8h-G88Q (same OH-SRH with diesel engine in case you wonder the weird sound of the engine :-))

This is from an old night flight on the C152 our club had, it has the similar panel lighting as the C172P: https://www.youtube.com/watch?v=xJCQ6hxAJ9U - also a GPSMap196 :-) Pardon the elevator muzak :-)

@gilbertohasnofb
Copy link
Member Author

@tigert thanks for the detailed post, I really appreciate it!

So, I am all up to implement at least the red spotlight. For that we will need:

  • create a clickable switch on top of the aircraft. If that's the case, we can maybe consider creating a proper 3D ceiling panel instead of the current 2D texture we have. What do you all say?
  • then we must decide which approach to take for the illumination: would it be possible for instance to simply illuminate certain object faces equally so that we don't need to use the lightmap nor the ALS light techniques? The problem with ALS light is that AFAIK it's dependent on the point of view, and so it will lead to weird effects when panning around the cockpit. Also, it's not uniform but pointed to one direction (@wlbragg please correct me if I am speaking rubbish).

Any suggestions? @onox what do you think? We can probably decide on this thread what to do and work on the light itself here, and maybe create a new issue for the top panel improvement if that's judged to be necessary.

And thanks once again to both @tigert and @Juanvvc for the detailed answers.

@onox
Copy link
Member

onox commented Aug 3, 2015

The only suggestion I have is to ask @wlbragg what's best. The lightmap looks cool though.

@tigert
Copy link
Contributor

tigert commented Aug 4, 2015

For night flight it would also be nice if the strobes would be visible inside - they are not directly visible, but they show via reflection:

  • from the ground, especially on winter if there is snow, it reflects strobes well from the ground. You can see this in the OH-SRH youtube video: https://www.youtube.com/watch?v=N2ZB8h-G88Q
  • when there is moisture in the air (mist/cloud) you will get a reflection from the water droplets and clouds when in the air. This also happens with the landing light, and it is especially visible in IMC: https://youtu.be/cd6ZX_FZfMQ?t=1532

This moisture-reflection likely should be gradual and increase in intensity based on the amount of air moisture (this could be derived from the distance of temperature vs dewpoint I guess) but I have no idea how this could be done through an effect - ideally FG could do this automatically for strobes and landing lights, but maybe we can prototype something on our Cessna and perhaps submit it "upstream" to flightgear..? Could perhaps ask Thorsten in the forum.

This similar effect could also be used for lightning strikes I guess - I would thin we don't currently have those implemented in FG?

@gilbertohasnofb
Copy link
Member Author

FG does not have lightning strikes implemented. As for the lights reflecting from the ground and in the moisture, it may be a bit tricky since ALS does not use real light sources but actually a trick that makes it look like a regular 3D light. So I believe that to have the strobes reflecting in the ground we would need to fake them just like with the current shadow and I doubt it would look realistic. As for the strobes while inside a cloud, maybe there is a way of tricking FG into creating a sudden spike of brightness in those conditions but applied only to the exterior world, but it also looks tricky to me. Anyway, these effects wouldn't be completely related to this issue and if they are possible to implement I would open a new issue and create a new branch for them.

Could perhaps ask Thorsten in the forum.

That would be ideal! He would give a more precise opinion about what is possible and what is not, and what he is willing to implement as well.

@wlbragg
Copy link
Collaborator

wlbragg commented Aug 9, 2015

Sorry for the late reply, I've been on vacation for the past couple weeks. A lightmap might work for this, but I am not sure we can turn it on and off in real time. I'll investigate.

@gilbertohasnofb
Copy link
Member Author

@wlbragg Great, let me know about it once you think of a plan 😄

@tigert
Copy link
Contributor

tigert commented Aug 30, 2015

We have lightning now in git. I wonder if that effect could be used for strobes though?

@onox onox modified the milestones: FlightGear 2016.2 features, FlightGear 2016.1 features Jan 9, 2016
@onox onox modified the milestones: FlightGear 2016.2 features, FlightGear 2016.3 features May 17, 2016
@wlbragg
Copy link
Collaborator

wlbragg commented Jul 25, 2016

OK, this is doable, we need to decide what lights we want then we can create the lightmaps and add the properties to control them. A small map light or something of that sort should be easy to do so don't "not" decide to make one because you think it hard to do.

@gilbertohasnofb
Copy link
Member Author

Great! Would we need one light map for each panel or just one for all of them? So now we "just" need to decide how to implement it, i.e. how the lights behave in the 172.

@wlbragg
Copy link
Collaborator

wlbragg commented Jul 16, 2018

NVIDIA GeForce GTX 650

As far as I know that GC should work fine. @dany93 can you run the shuttle? IF so do you get any interior lighting in it.
As far as I know we don't test for or support Rembrandt and it should be off.

As @gilbertohasnofb indicated, if the "instrument light" knob is at 100% and you have power to the buss, you should see something in the way of lighting on the panel no matter the configuration of the overhead switches. The one slider on the overhead only controls the dome lighting so it isn't a factor for our testing/debugging purposes.

I am squeezed for time until tonight, let me think about this and see if I can come up with a foolproof test to help debug this.

In the meantime, if you can, please try the shuttle. Or any other aircraft that we can determine is using a light map. I can't off the top of my head think of any other, but there has to be others. Does the 182 have any light map lighting?

@wlbragg
Copy link
Collaborator

wlbragg commented Jul 16, 2018

Tested with the DR400 JSBSim, it works.

Are you saying that aircraft has light maps and that they worked?

@gilbertohasnofb
Copy link
Member Author

Rembrandt?
Tested with the DR400 JSBSim, it works.

Rembrandt lights are yet another technique which is different than using light maps AFAIK.

@wlbragg
Copy link
Collaborator

wlbragg commented Jul 16, 2018

Does ALS use lightmap for the c172 shadows (in the cockpit, on the dashboard)?

No, that is a different technique.

@HHS81
Copy link
Contributor

HHS81 commented Jul 16, 2018

@wlbragg yes, the c182 uses lightmaps. We have for each of the three dome lights one lightmap, one for the glareshield light, and one for the center pedestal light. Just the instruments doesn't use lightmaps and that's o.k. for me.

@gilbertohasnofb
Copy link
Member Author

@dany93 please give the c182s a spin then and tell us what you can see. I will switch to my Nvidia card and test both the c172p and the c182s later tonight and let you know of what I can see.

@gilbertohasnofb
Copy link
Member Author

Just confirming that the light maps of both the c172p as well as the c182s work fine on my laptop regardless of the video card I use (tested with both a NVIDIA GeForce GTX 1050 and an Intel HD Graphics 630).

@dany93
Copy link
Collaborator

dany93 commented Jul 16, 2018

image

c182s from FGAddon, this day
I guess that the three or four instruments with no illumination are those with light maps?

@gilbertohasnofb
Copy link
Member Author

@dany93 could you try turning the GLARESHIELD knob (bottom knob, rotate the inner part) all the way to 100% and post an image?

@dany93
Copy link
Collaborator

dany93 commented Jul 16, 2018

image
With Glare shield Lights 100%

@gilbertohasnofb
Copy link
Member Author

@dany93 Yeah, the light map is definitely broken for you. You should see something like this:

Since this happens with aircraft from both projects I suspect this issue is related to your video card and/or to the implementation of the light maps in the source code rather than anything we did here locally. Maybe we could raise this issue with Thorsten.

@wlbragg
Copy link
Collaborator

wlbragg commented Jul 16, 2018

@dany93 can you also post your log using loglevel = debug

@dany93
Copy link
Collaborator

dany93 commented Jul 16, 2018

fgfs.log
Error!! it was not debug level.
Please see below.

@wlbragg
Copy link
Collaborator

wlbragg commented Jul 16, 2018

@gilbertohasnofb I wonder if we shouldn't include an option in the GUI to use integral lighting (material animation) instead of post lighting (light maps) for those with weaker GPU's.

I know this is probably the 3rd time I have suggested this and we keep deciding against it. But I am concerned that we are going to catch flack from the dev list folks if we get very many reports of the light maps not working and users have no panel lighting

It would be a GUI option similar to the shadow VS no shadow. Or complex engine VS easy.

Or we just add integral lighting to the entire panel under the "Panel lighting" rheostat, instead of only the compass and the RMP.

Think about it!

@dany93 I didn't see anything out of the ordinary in your log, thanks for posting it.

@gilbertohasnofb
Copy link
Member Author

I wonder if we shouldn't include an option in the GUI to use integral lighting (material animation) instead of post lighting (light maps) for those with weaker GPU's.

Surely we can consider doing that in this case if you want to go through the trouble, but personallyI would rather focus on developing more interesting things for the major upcoming release. Our aircraft is already quite heavy so that folks on very low end PCs might not be able to fly it any longer (though they have the option of reverting to any old state of our master if that's the case). We need to make a simple decision: do we try to cater for everyone including those with very low end PCs or do we focus on new features and showcasing what the sim is capable of as of 2018? There is nothing wrong with the first but I thought we all kind of agreed on the second. And implementing two systems (a pretty one for high end PCs and a simpler one for low end) could end up adding more stuff to the code which might in turn make the performance of the aircraft even more problematic (though it might be negligible in this very case, I am writing as a general approach, ok?).A better approach would possibly be to alert Thorsten and see if he can fix the issue on his side.

But if that doesn't solve anything and you don't think this is too much trouble then by all means let's do it, I would be happy to help with testing or with the dialog part of the issue.

@gilbertohasnofb
Copy link
Member Author

gilbertohasnofb commented Jul 16, 2018

Or we just add integral lighting to the entire panel under the "Panel lighting" rheostat, instead of only the compass and the RMP.

I wholeheartedly disagree with this suggestion. We haven't seen a single model P having that and I would find it sad that we would compromise a proper simulations just to hack our way around a graphic bug. This would also teach people that the RADIO LT would control all panel lights and that PANEL LT would do nothing, which is unrealistic. IMO that's a big no no.

edit:
So what do you think about first contacting Thorsten and then if that doesn't solve it we implement your idea of a GUI toggle? Would you mind writing him yourself since I don't have any knowledge about how these light maps were implemented?

@dany93
Copy link
Collaborator

dany93 commented Jul 17, 2018

Some more info about my config, in case Thorsten would ask for it.

Dell XPS 420 Intel Core2 Quad CPU Q6600 @ 2.40GHz, RAM 4 GB
Graphics card: NVIDIA GEFORCE GTX 650 1GB (driver 384.130)
Linux Mint 18 Cinnamon (64 bits)
_________________________________________

lsb_release -a
LSB Version:	core-9.20160110ubuntu0.2-amd64:core-9.20160110ubuntu0.2-noarch:security-9.20160110ubuntu0.2-amd64:security-9.20160110ubuntu0.2-noarch
Distributor ID:	LinuxMint
Description:	Linux Mint 18 Sarah
Release:	18
____________________________________________

FlightGear  07fac8c Thu, 5 Jul 2018 21:28:53 +0200
SimGear     0e9e5f7 Thu, 5 Jul 2018 10:29:03 +0200
FGData      6a6c054 Tue, 3 Jul 2018 17:28:10 +0100
PLIB        a542b8a Wed, 4 Oct 2017 17:33:51 +0200

Linux Mint 18, OSG 3.2.1, Qt 5.5


@dany93
Copy link
Collaborator

dany93 commented Jul 17, 2018

If, unfortunately, the decision is to include an option, I think that the setting would be better at the FlightGear level (before launching, like Rembrandt ON / OFF) because it will concern several aircraft.

@dany93
Copy link
Collaborator

dany93 commented Jul 17, 2018

My first fgfs.log was not at debug level.

Here is one at debug level.
fgfs.log

Sorry.

@wlbragg
Copy link
Collaborator

wlbragg commented Jul 18, 2018

@dany93 still nothing noticeable or wrong that I expected to see in the logs, thanks.
Would you mind posting your specs to the Dev list and ask the question there about that card and it is known to have a problem with light map shader. Make sure you generalize it and attribute the problem to more aircraft than only the c172p. More eyes on it the more likely we'll get answers.

I looked up some details on that card and I am convinced that it should be working if everything is current and nothing is broken.

You can try a long shot and change the version numbers on the shader being used, (remember to change it back if it doesn't work).

At the top of the shader files in fgdata/Shaders/
model-interior-ALS-detailed.frag
and
model-interior-ALS-detailed.vert
there is a line
#version 120

Try changing the line in each of those files to
#version 110
if that doesn't work try
#version 400

Again, remember to change it back if it doesn't work.

It's a long shot and more for my curiosity.

Surely we can consider doing that in this case if you want to go through the trouble,

@gilbertohasnofb it's not much trouble or work, and I'm no where near adamant about it. I am only trying to head off any future negative critiques from the dev list folks and also cater to the wider audience who may still be able to run this aircraft. I don't necessarily look at this graphics issue as a less powerful hardware case as we don't really know the scope of the issue.

If it is only a few systems that have this problem then maybe it is not a good idea. I guess we need to gather some more information as to the scope of the problem before deciding a fix, if any.

@gilbertohasnofb
Copy link
Member Author

If it is only a few systems that have this problem then maybe it is not a good idea. I guess we need to gather some more information as to the scope of the problem before deciding a fix, if any.

This. Agreed 100%. So let's see what comes out from the mailing list and from Dany's tests and then we see what to do. I sympathize as well with avoiding future negative critiques, but let's keep in mind that this is a problem with the light map system not our aircraft. So let's wait for some more information and then we decide how to proceed -- I would be happy to help if we decide to implement the fix you mentioned.

@dany93
Copy link
Collaborator

dany93 commented Jul 18, 2018

@wlbragg
model-interior-ALS-detailed.frag
model-interior-ALS-detailed.vert
#version 110 or 400 changes nothing.
(Changed it back on 120)

@onox
Copy link
Member

onox commented Jul 20, 2018

@wlbragg My potato is 5 years old. And it can run the c172p with the light maps just fine. Maybe not 60 fps (rather 20 to 25), but it's still flyable (as long as I avoid certain scenery). Do we really want to support videocards that are over a decade old and have 6x less GFLOPS than my Intel card? I say those people can use the basic renderer instead.

@dany93 Have you tried running the space shuttle as @wlbragg suggested? Light maps should be broken there too. Do you have some Nvidia control panel program on Linux to set certain settings?

@gilbertohasnofb
Copy link
Member Author

I say those people can use the basic renderer instead.

@onox I agree with you on this.

Have you tried running the space shuttle

That could be useful, dany. If by any change the shuttle runs fine then the issue would be with how the light maps are implemented in the c172p and c182s, though I find that to be very unlikely to be the problem.

@dany93
Copy link
Collaborator

dany93 commented Sep 3, 2018

On 16 jul 2018, I wrote:

I cannot get your very nice instrument lighting as in this message (28 june 2018). I guess this is what you call "post illumination"?

I asked in FGDevel mail list, Thorsten lead me to the the solution.

In Rendering Options > Shader Effects , Custom settings was unchecked (probably by default). With Shader effects are at 4 (from 0 to 4 / 4), but it was not enough.
After checking it, > Shader Options: I saw that the "Model" shader slider was at 1 (from 0 to 3 / 3). By setting it at 2 or 3 / 3, everything works.

Solved for my question, thank you for your responses.

@wkitty42
Copy link
Contributor

wkitty42 commented Sep 3, 2018

Glad you found that, @dany93 !

This is one of the types of things that I hate having to dig around to find and fix. There are numerous pieces of eye-candy in the sim and many craft. Without certain higher shader effects being enabled, those pieces are not rendered. Turn up the setting and they appear but may cause some FPS loss.

This type of thing is why my Additional Settings in the launcher is 150+ lines where I set properties to my defaults and comment about them 😸

@dany93
Copy link
Collaborator

dany93 commented Sep 3, 2018

I wrote it too quickly...

I didn't find the solution by myself, Thorsten lead me to it.

@wlbragg
Copy link
Collaborator

wlbragg commented Sep 3, 2018

Wow, how'd we all miss that, it was to simple? 😆

@callahanp
Copy link

callahanp commented Oct 23, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants