FSX Dimmed Additive Self-Illumination

#1
Let's assume we have a panel light switch in our VC and we want to create convincing gauge lighting for the usual dusk, dawn, and night scenarios - and perhaps for special daytime situations, too.

Consider the following pics: #1 shows a largely illegible daylight panel caused by adverse ambient light; pic #2 shows the identical situation with low-intensity self-illumination, and pic #3 shows the panel at dusk (dawn and night looking pretty much identical). The general idea is to create a good balance between all combinations of interior and exterior lighting conditions.



Naturally, our main point of departure is Bill Leaming's Emissive Texture Tutorial, available here: https://www.flightsim.com/vbfs/wiki_index.php?title=FSX-Emissive-Textures

Let's follow Bill's tutorial up to the point where in your panel material you put the $-texture in the diffuse slot and an "instance" of it into the self-illumination slot.

For blend mode set "additive user-controlled". Now, because the resulting effect will be far too bright, we will use a much simplified version of Anthony31's dimming code as introduced in a thread here at FSDevelopers: https://www.fsdeveloper.com/forum/threads/a-gauge-to-compensate-for-light-levels.436422/

Edit --
Belatedly, I now realize that the 'innovative' process I am introducing here has already been discussed at quite some length in this thread:
https://www.fsdeveloper.com/forum/threads/dimmable-night-lighting.429475/post-666012
Carrying on regardless...
end edit

This is what we will do. For each visible gauge we will add an element to the gauge's already existing elements:

Code:
<Element Name="paneldimmer">
  <Visible>(A:LIGHT PANEL,bool)</Visible>
  <Rectangle Width="XXX" Height="YYY" FillColor="#140400" Transparency="0.39"/>
</Element>
Replace XXX and YYY by the actual width and height used by the gauge. Depending on how many gauges you need to modify in this manner this may turn out to be quite a bit of work. However, at the end of the day, it is a very simple and mechanical process.

Note, if your gauge uses the more verbose FSX-specific xml scheme, you may have to use the terms <Element id="paneldimmer"> and <Visibility>(A:LIGHT PANEL,bool)</Visibility>

You can of course tweak FillColor and Transparency to your own preference. Color #140400 as used here puts a slight reddish tint on the gauges; 39% Transparency yields the very subdued lighting seen in the pics. Naturally, increasing the Transparency value will make the gauges brighter.

Note that the orangey ambient shine in pic #3 is produced by a vclight fx, which seems to support this type of self-illumination well.

If desired or needed, some sophistication is easily added. For instance, we could create a dimmer knob that the pilot can twiddle from OFF to LOW to BRIGHT, which, I understand, in one form or another is a feature in many cockpits. All that we need for this is an Lvar that defines two vis conditions and a second <Element> that uses a higher Transparency value for showing the brighter illumination.

FWIW ....
--Manfred
 
Last edited:

n4gix

Resource contributor
#2
Very nicely done. Yikes! I need to locate an archived PDF version of that "White Paper" since the Wiki entry at Flightsim.com has degraded over the last decade to the point of near uselessness... :eek:

Oh my, a google search has revealed that both of my White Papers have disappeared from every site that used to host them. Hopefully I'll be able to locate them in my mare's nest of archived stuff... :rotfl:
 

Heretic

Resource contributor
#4
Does the "Transparency" flag accept values from a variable or macro?
If so (can't remember if I ever tested it thoroughly), you won't need tens of <Element> based masks to implement pretty much seamless dimming.



Very nicely done. Yikes! I need to locate an archived PDF version of that "White Paper" since the Wiki entry at Flightsim.com has degraded over the last decade to the point of near uselessness... :eek:

Oh my, a google search has revealed that both of my White Papers have disappeared from every site that used to host them. Hopefully I'll be able to locate them in my mare's nest of archived stuff... :rotfl:
That one?

https://www.fsdeveloper.com/forum/resources/developing-virtual-cockpit-lighting.123/
 
#5
Macro yes, variable no, AFAIK, so you would need n of those elements. Haven't tried, but that's the way Anthony's clever code has it.

That link is a dud, unfortunately, but why don't we just upload my copy to the server here...
 
Last edited:
#13
I've added it - it's awaiting approval. Thanks - never done that before.
That's a monumental understatement! :duck: :duck: :duck: :duck:

LOL, I will change every single photograph in the living room for all code snippets I learned from all of you guys! ;)

Thank you kindly.
Sergio.
 
Top