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

Dynamic Lights

Messages
139
Country
us-texas
Hello,

There are a variety of tutorials and items of guidance on this topic. My dynamic lights performance in the sim has been great since the earlier days of 4.x. However, I've recently installed a scenery from Robert Cahterall for RJAA (by way of Ray Smith) and the dynamic lights he's included are MURDER on my frames in a way that hasn't been the case since 2017.

My question is this: is there a preferred 4.5.x method for including a dynamic light effect (for airport ground lighting from a light tower in a parking area) that realizes best performance. For instance, the inibuilds folks offer dynamic lights updates to popular airports and their lights are performance friendly.

I've followed along in the MCX discussions about HOW to do it, but I'm wondering why Robert's lights perform so horribly and how I can take his light tower object and replace the effect with something that is performance friendly. So far I have extracted the light tower model with MCX and I feel that I might be able to replace the objects in the scenery by attaching a new effect that is performant.

Of course I could skip all of this if I knew why these lights performed so lousy. Robert seems to be on hiatus from scenery stuff, so I'm trying to figure this out on my own using MCX and ADE.

Kind regards!

:)
 
Hi,

I am here to ask my question again.

Can anybody point me to a method for using dynamic lighting effects and a controller file?
 
I'd like to create dynamic lights, that are not attached to a model, that light up aprons in P3Dv5.
 
Okay, so here I am about 2.5 years later and I find that no answers to my question to be somewhat representative of the hit-and-miss nature of FSDeveloper and part of the reason why this stuff stays relegated to the "dark arts." I am grateful that FSDeveloper has been here for all these years, but questions like this one seem to often go unanswered.

I got the following to work mainly by copy-catting other installed projects (3rd party commercial) and following the SDK.

Now that it works, a better way to ask my question would have been:

"I just want dynamic lights in my scenery they way inibuilds places dynamic lights" or something like that.

STEP ONE:
You need the dynamic light effect file itself. FSX/P3D effects files are just text files. Here's my effect which is contained in a file called tvp_fx_spotlight_cntrl.fx:

Code:
[Library Effect]
Lifetime=5
Version=2.00
Display Name=TVP Light
Radius=100
Priority=0

[Properties]
Spot=1
Tower=1
Map=1

[Emitter.0]
Lifetime=0.50, 0.50
Delay=0.00, 0.00
Bounce=0.00
Rate=1.00, 1.00
X Emitter Velocity=0.00, 0.00
Y Emitter Velocity=0.00, 0.00
Z Emitter Velocity=0.00, 0.00
Drag=0.00, 0.00
X Particle Velocity=0.00, 0.00
Y Particle Velocity=0.00, 0.00
Z Particle Velocity=0.00, 0.00
X Rotation=0.00, 0.00
Y Rotation=0.00, 0.00
Z Rotation=0.00, 0.00
X Offset=0.00, 0.00
Y Offset=0.00, 0.00
Z Offset=0.00, 0.00
Pitch=75.0, 75.0
Bank=0.00, 0.00
Heading=0.00, 0.00

[Particle.0]
Lifetime=0.000000, 0.000000
Type=28
X Scale=100.00, 100.00
Y Scale=0.00, 0.00
Z Scale=0.00, 0.00
X Scale Rate=0.00, 0.00
Y Scale Rate=0.00, 0.00
Z Scale Rate=0.00, 0.00
Drag=0.00, 0.00
Color Rate=0.00, 0.00
X Offset=0.00, 0.00
Y Offset=0.00, 0.00
Z Offset=0.00, 0.00
Fade In=0.00, 0.00
Fade Out=0.00, 0.00
Static=1
Face=0, 0, 0

[ParticleAttributes.0]
Color Start=255, 255, 192, 128
Color End=255, 255, 192, 128
Bounce=0.00
X Scale Goal=0.00
Y Scale Goal=0.00
Z Scale Goal=0.00
Falloff Exponent=2.00
Inner Cone Angle=20.00
Outer Cone Angle=45.00
Intensity Day=0.00
Intensity Night=1250.00

The stuff that matters the most is Color Start, Color End, Inner Cone Angle, Outer Cone Angle, and Intensity Day/Night. The Intensity setting seems to be more specific to P3Dv5 and replaces earlier approaches. Display Name is just the unique name you give this effect. Microsoft likes to call these "friendly names."

STEP TWO:
For reasons that I still don't fully understand, you need an effects controller file that refers the actual effect; it is the controller that gets referred to when compiling the light into a placable effect.

Here is my controller
Code:
[Library Effect]
Lifetime=5
Version=1.00
Radius=200
Priority=0

[controller.0]
lifetime=0.00, 0.00
type=3
distance=10000.00, 10000.00
delay=1000000.00, 1000000.00
x offset=0.00, 0.00
y offset=0.00, 0.00
z offset=0.00, 0.00
effect.0=tvp_fx_spotlight, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00

STEP THREE:
Create a BGL placement file so that the BGL Compiler that comes with the SDK can be used to create a file that places the dynamic light into the scenery so that you can see/enjoy it. This is an XML file and it can be used to compile the BGL by simply dragging it onto the bglcomp.exe program in the SDK. In this example, I am placing a light near gate E9 and gate A13 at KPHX.

XML:
<?xml version="1.0" encoding="UTF-8"?>
<FSData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="9.0" xsi:noNamespaceSchemaLocation="bglcomp.xsd">
   <!--KPHX_GATE_E9_Spot-->
   <SceneryObject lat="33.437959" lon="-112.008801" alt="25M" pitch="0" bank="0" heading="0" altitudeIsAgl="TRUE" imageComplexity="NORMAL">
      <Effect effectName="tvp_fx_spotlight_cntrl" />
   </SceneryObject>
 
   <!--KPHX_GATE_A13_Spot-->
   <SceneryObject lat="33.437974" lon="-111.999301" alt="25M" pitch="0" bank="0" heading="0" altitudeIsAgl="TRUE" imageComplexity="NORMAL">
      <Effect effectName="tvp_fx_spotlight_cntrl" />
   </SceneryObject>
</FSData>

STEP FOUR:
The effects files go into the Effects directory where your simulator is installed. As for the compiled BGL file, I recommend following these instructions from the SDK documentation: https://www.prepar3d.com/SDKv5/prepar3d/world/scenery_library/scenery_library_overview.html

I hope that the search engine gods make this easy for others to find if they ever want to accomplish the same task. Now for the 99,998 other development mysteries to solve in the now-forgotten ESP codebase.
 
Last edited:
Back
Top