How do I change the intensity of runway lights in real-time?

0 votes
asked May 4 by Komministern (12 points)

I'm trying to get custom light intensity on a runway light working. It is for my purposes important that I am able to change the light intensity of my custom runway lights in real time.

I've identified two possible paths to get this working, and failed miserably trying on both accounts. It seems that I am profoundly missing understanding in this area, and really need some pointers.

In both cases, I start with the object 'elevated_edge_WW.obj' and try to tweak it to my intentions. First I move this obj file, with its associated texture files, to my custom test airport, tweak it, and then, in WED, place an instance of this obejct on a runway. After exporting the test airport to X-Plane, I then study the result in the simulation.


First approach, ATTR_light_intensity:

Here I simply add the line 'ATTR_light_intensity 0.0 1.0 my/dataref':

A
800
OBJ

TEXTURE ../apt_lights.dds
TEXTURE_LIT ../apt_lights_LIT.dds
...
VT and IDX10 here.
...
ATTR_LOD 0.000000 500.000000
ATTR_layer_group light_objects 0
TRIS 0 1326
ATTR_light_level 0.0 1.0 my/dataref
LIGHT_NAMED edge_w 0.000000 0.440000 0.000000
LIGHT_NAMED edge_w_rev 0.000000 0.440000 0.000000
LIGHT_NAMED edge_ww_halo 0.000000 0.000000 0.000000

My dataref returns a float and is both readable and writeable. (I also registered it in DRE so that I can edit its value in real time.)

No matter how I change the value of the dataref, nothing happens with the apparent light intensity of the light though. Have I totally misunderstood the whole concept of the ATTR_light_level? (I suspect I have.)


Second approach, CUSTOM_LIGHT:

Here I comment out the named lights in the "pedistal" obj file:

A
800
OBJ

TEXTURE ../apt_lights.dds
TEXTURE_LIT ../apt_lights_LIT.dds
...
VT and IDX10 here.
...
ATTR_LOD 0.000000 500.000000
ATTR_layer_group light_objects 0
TRIS 0 1326
# LIGHT_NAMED edge_w 0.000000 0.440000 0.000000
# LIGHT_NAMED edge_w_rev 0.000000 0.440000 0.000000
# LIGHT_NAMED edge_ww_halo 0.000000 0.000000 0.000000

and then I place an instance of the following custom object in the same coordinates as the pedistal object (now without named lights) above:

A
800
OBJ

TEXTURE ../1000_lights_close.dds

ATTR_LOD 0.000000 10000.000000
ATTR_layer_group light_objects 0

LIGHT_CUSTOM 0.000000 0.440000 0.000000 1.0 1.0 1.0 1.0 1.4 0.0625 0.625 0.125 0.750 NULL
LIGHT_SPILL_CUSTOM 0.00 0.44 0.00 1.0 1.0 1.0 1.0 1.7 0 0 0 1.0 NULL

I still have not bothered with writing the datarefs, because after exporting this configuration to X-plane, thing go awry again. I want this custom light to look more or less like the original runway light. The alpha value would then (that at least is the plan) take care of the apparent light intensity. And, placed in free space it kind of does. But when placed in the same coordinates as the pedistal, the light gets drawn BEHIND the pedistal object. Not in front of, with alpha blending, as I would have hoped. (The LIGHT_SPILL_CUSTOM looks nice though.)

I have not yet tried this on XP11. These experiences are all from experimenting with the latest version of XP10.

So, my questions are:

1. Am I even on the right track here?
2. Is the ATTR_light_level approach feasible, and if so, what am I doing wrong?
3. Is the CUSTOM_LIGHT approach feasible, and if so, in which direction should I proceed to make it work?
or
4. Is there a another way of achieving custom real-time controlled light intensity for my runway lights?

Best regards,
Oscar.

1 Answer

0 votes
answered May 7 by jroberts (17,587 points)

This is more specialized than I can personally help with, but you might have better luck asking in an X-Plane scenery development forum here.

Welcome to X-Plane Q&A, where you can ask support questions and get answers from members of the community.

This site is for X-Plane support questions only. Please search for existing answers before posting your question. Off-topic questions will be locked.

If you’re new, you’ll need to register before asking your first question.

If your question is answered, click on the check mark to select the best response.

...