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

FSXA Dimmable night lighting

euroastar350

Resource contributor
Messages
862
Country
us-delaware
Hi all,


How can I go about adding dimmable night lighting to one of my current projects? My current helicopter project has 7 switches which are all dimmable and they control light intensity for various areas of the cockpit. Would I have to create a light logic and a XML script for the switch and lights to work? Any help is appreciated.
 
Hi euroastar

I am a relative newbie to aircraft design working in fs9. I developed a dimmable light system for my current project's gun sight. If memory serves I painted the sight texture layer, made various opacity layers of the gun sight, applied each layer to a 000 background layer and processed each into a transparent bitmap and _lm. Then I applied the bitmaps to flat poly parts hidden behind the panel. Then key frame animated each part to move from it's hide location in sequence to the gun sight face as the dimmer switch was dragged. Not knowing how to do it with code I just did it mechanically.

Carl
 
These two points need to be kept in mind:
1. things cannot be made brighter, only dimmer
2. always use Additive mode for your FSX Material's Emissive property as this is the only 'mode' that will work all the time; dawn, day, dusk, and night. All other 'modes' will only work a night!

The chief problem is that unless you are very proficient in C++ and creating and applying DX10 shaders, variable lighting of non-gauge parts of a virtual cockpit is simply not achievable. Any gauge mapped VC object however can have a tiny "XML gauge" assigned to the Self-Illumination slot of your FSX Material.

These "XML gauges" are nothing more complex than a simple rectangle that applies a progressively lighter transparency layer to the underlying texture. The script below is an example of this. It is a 64x64 "gauge" that is assigned to the $C310_VC_04 texture placed in the Self-Illumination slot.
Code:
//--------------------------------------------------------
[Vcockpit04]
Background_color=0,0,0
size_mm=64,64
visible=1
pixel_size=64,64
texture=$C310_VC_04
 
gauge00=C310_XMLGauges!InstPanel_dimming,  0,0,64,64
The XML script below provides 20 levels of lighting control from "off" to "full bright."
Code:
<Gauge Name="InstPanel" Version="1.0">
   <Element>
      <Select>
         <Image Name="White_Backlight_Test.bmp"/>
      </Select>
   </Element>
  <Update Hidden="No">
    (L:EngLts,bool) 0 ==
    if{
    10 (>L:SwitchEngLts,enum)
    1 (>L:EngLts,bool)
    }
  </Update>
   <!--   DIMMING MASK  -->
   <Element>
      <Position X="0" Y="0"/>
      <Element>
         <Visible>(L:SwitchEngLts, enum) 0 ==</Visible>
         <Rectangle Width="64" Height="64" FillColor="black" Transparency="0.0"/>
      </Element>
      <Element>
         <Visible>(L:SwitchEngLts, enum) 1 ==</Visible>
         <Rectangle Width="64" Height="64" FillColor="black" Transparency="0.05"/>
      </Element>
      <Element>
         <Visible>(L:SwitchEngLts, enum) 2 ==</Visible>
         <Rectangle Width="64" Height="64" FillColor="black" Transparency="0.1"/>
      </Element>
      <Element>
         <Visible>(L:SwitchEngLts, enum) 3 ==</Visible>
         <Rectangle Width="64" Height="64" FillColor="black" Transparency="0.15"/>
      </Element>
      <Element>
         <Visible>(L:SwitchEngLts, enum) 4 ==</Visible>
         <Rectangle Width="64" Height="64" FillColor="black" Transparency="0.2"/>
      </Element>
      <Element>
         <Visible>(L:SwitchEngLts, enum) 5 ==</Visible>
         <Rectangle Width="64" Height="64" FillColor="black" Transparency="0.25"/>
      </Element>
      <Element>
         <Visible>(L:SwitchEngLts, enum) 6 ==</Visible>
         <Rectangle Width="64" Height="64" FillColor="black" Transparency="0.3"/>
      </Element>
      <Element>
         <Visible>(L:SwitchEngLts, enum) 7 ==</Visible>
         <Rectangle Width="64" Height="64" FillColor="black" Transparency="0.35"/>
      </Element>
      <Element>
         <Visible>(L:SwitchEngLts, enum) 8 ==</Visible>
         <Rectangle Width="64" Height="64" FillColor="black" Transparency="0.4"/>
      </Element>
      <Element>
         <Visible>(L:SwitchEngLts, enum) 9 ==</Visible>
         <Rectangle Width="64" Height="64" FillColor="black" Transparency="0.45"/>
      </Element>
      <Element>
         <Visible>(L:SwitchEngLts, enum) 10 ==</Visible>
         <Rectangle Width="64" Height="64" FillColor="black" Transparency="0.5"/>
      </Element>
     <Element>
       <Visible>(L:SwitchEngLts, enum) 11 ==</Visible>
       <Rectangle Width="64" Height="64" FillColor="black" Transparency="0.55"/>
     </Element>
     <Element>
       <Visible>(L:SwitchEngLts, enum) 12 ==</Visible>
       <Rectangle Width="64" Height="64" FillColor="black" Transparency="0.6"/>
     </Element>
     <Element>
       <Visible>(L:SwitchEngLts, enum) 13 ==</Visible>
       <Rectangle Width="64" Height="64" FillColor="black" Transparency="0.65"/>
     </Element>
     <Element>
       <Visible>(L:SwitchEngLts, enum) 14 ==</Visible>
       <Rectangle Width="64" Height="64" FillColor="black" Transparency="0.7"/>
     </Element>
     <Element>
       <Visible>(L:SwitchEngLts, enum) 15 ==</Visible>
       <Rectangle Width="64" Height="64" FillColor="black" Transparency="0.75"/>
     </Element>
     <Element>
       <Visible>(L:SwitchEngLts, enum) 16 ==</Visible>
       <Rectangle Width="64" Height="64" FillColor="black" Transparency="0.8"/>
     </Element>
     <Element>
       <Visible>(L:SwitchEngLts, enum) 17 ==</Visible>
       <Rectangle Width="64" Height="64" FillColor="black" Transparency="0.85"/>
     </Element>
     <Element>
       <Visible>(L:SwitchEngLts, enum) 10 ==</Visible>
       <Rectangle Width="64" Height="64" FillColor="black" Transparency="0.9"/>
     </Element>
     <Element>
       <Visible>(L:SwitchEngLts, enum) 18 ==</Visible>
       <Rectangle Width="64" Height="64" FillColor="black" Transparency="0.95"/>
     </Element>
     <Element>
       <Visible>(L:SwitchEngLts, enum) 19 ==</Visible>
       <Rectangle Width="64" Height="64" FillColor="black" Transparency="1.0"/>
     </Element>
   </Element>
</Gauge>
 
I wanted to add that using a similar technique described above, one could take a full sized texture sheet with multiple gauge "faces" and/or "text" and script many smaller rectangular 'masks' that are individually controllable by more than one light knob... :wizard:
 
Thank you Bill. This will work with 3D gauges as well or strictly just 2D gauges mapped into the VC? Just want to clarify before I go further with this.
 
Thank you Bill. This will work with 3D gauges as well or strictly just 2D gauges mapped into the VC? Just want to clarify before I go further with this.
Yes, it will work just fine! Although in this case you would create a "dimmable gauge" or set of "gauges" that will cover the entire Diffuse texture you use for the gauge faces and/or needles.

The "trick" is that you need to work with the .dds texture oriented as it is used by the sim when calculating the x,y and w,h values for your Rectangles. In other words, I load the bitmap in Photoshop and make certain that it is "Flipped Vertically" as I draw out the "rectangular zones" for my lighting control. If like me you have different areas on a single bitmap, such as an overhead panel, as well as parts of the main panel, you can script your rectangle <Element>s such that they use different knobs.

Here is a screenshot illustrating how the FSX Material is set up for one of my panel textures. Note that a $VC type bitmap is specified in the Self-Illumination slot. This is what allows me to create the panel.cfg entry on which to load the XML gauge(s) that might be required:
Code:
//--------------------------------------------------------
[Vcockpit01]
Background_color=0,0,0
size_mm=1024,1024
visible=1
pixel_size=1024,1024
texture=$B737_VC_Ovhd_1

gfwi.png

Here is a 1/2 size screenshot of the "Diffuse" texture used. Some of those "gauge faces" are on the overhead panel, the rest are on the main panel.
grqu.png
 
Very excellent Bill, I will bookmark this so when the time comes, I can apply this to my current project :)
 
Note also that there are some sub-panels with text labels. If you need to light the text, then you can include a mostly transparent bitmap in the XML "gauge" with only the text layer present. You can then create a masking rectangle for those areas and control it separately as well...

...and by altering the color of the text layer of that bitmap, you can provide the illusion of "electro-luminescent text" (ELT).
 
Another useful tip, I will keep this in mind once I get to this area which isn't too far off as I already have my gauges mapped and textured ;)
 
Bill, can "FX" based effects be made dimmable or do I have to do that to my 3D object. I want my inner cabin to have dimmable lighting, but I'm not sure if FX lighting is able to be dimmable or I have to go the 3D object route.
 
Bill, can "FX" based effects be made dimmable or do I have to do that to my 3D object. I want my inner cabin to have dimmable lighting, but I'm not sure if FX lighting is able to be dimmable or I have to go the 3D object route.
Unfortunately, no. Effects are not "controllable" at all. :oops:
 
Bill, can "FX" based effects be made dimmable or do I have to do that to my 3D object. I want my inner cabin to have dimmable lighting, but I'm not sure if FX lighting is able to be dimmable or I have to go the 3D object route.

My 737 uses two different .fx files. One is for low intensity, one is for high intensity. The former is configured as cockpit lights, the latter is (for some reason - can't remember why) configured as "recognition" light. Works well enough as I can't work with gauge backlighting.
 
I guess the FX route is in order, will save me a hassle and free me up to do other tasks on the model ;)
 
I'm interested in this thread as I want to create a realistic radar sweep using animated images as part of an illumination map. But I simply cannot get a $VC texture to work as an emitting light map texture. I have no problem using regular dds textures, but not a $VC.bmp. It just won't show. I know my gauge works as it will show the $VC.bmp if I use it as the diffuse texture. I have to say it would never have occurred to me that one could use a $ texture as the LM before I saw this thread.

I am compiling from Blender, but I don't see what that should make a difference.
 
Are you placing the overall VC night texture(s) into the plane's Texture folder?
 
Last edited:
I have assumed they should go in the panel subfolder with the xml gauge but I believe I tried the plane's main texture folder as well. Which folder should they be in?

I would really like this to work as the alternatives are difficult and won't look nearly as good. I did do a version with a rotating polygon using 3d landing light material just to see what it would look like (really good as it turned out) but for part of the rotation the poly sticks out of the radar box so that is not a solution.
 
Michael, can you send me the details on the radar system you are modelling? Curious about it.
 
Sorry, I was talking about the VC textures not the gauge textures.
 
I have assumed they should go in the panel subfolder with the xml gauge but I believe I tried the plane's main texture folder as well. Which folder should they be in?
There is no real bitmap required to be placed anywhere! The $... prefix merely tells FSX/P3D to create a "memory bitmap" on which 'gauges' may be defined and placed via the panel.cfg file.

You must also set the Emissive Mode in the FSX Material to "Additive" mode in order for it to be lighted.
 
I have tried with and without bitmaps. Ideally the gauge will use a rotating graduated bitmap over a uniform background. The material is set to additive emissivity. I just can't get any form of $texture to function as a light map texture.
 
Back
Top