• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSX Dimmed Additive Self-Illumination

  • Thread starter Deleted member 1281
  • Start date
D

Deleted member 1281

Guest
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.

Ep1fiw6v7O.jpg


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 by a moderator:

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
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
Messages
6,830
Country
germany
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/
 
D

Deleted member 1281

Guest
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 by a moderator:

n4gix

Resource contributor
Messages
11,674
Country
unitedstates

tgibson

Resource contributor
Messages
11,327
Country
us-california
Hi Bill,

I've added it - it's awaiting approval. Thanks - never done that before.
 
Messages
1,451
Country
mexico
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