Question Cockpit spotlight visual disappears when another spotlight is switched on?

Thunder Chicken

Resident Lua Script Rabble-Rouser
Donator
Joined
Mar 22, 2008
Messages
5,847
Reaction score
5,509
Points
188
Location
Massachusetts
So I have put some red spotlights into the cabin of the R-4 to illuminate it in all directions. I have two spotlights, each at the same location above and behind the center pilot seat, with an umbra angle PI facing in opposite directions, basically making a single light that emits in all directions.
Looking forward:
Screenshot at 2025-02-10 15-12-19.png
Looking aft:
Screenshot at 2025-02-10 15-02-13.png
These lights are created and set using the following functions:

Code:
function make_pretty.cabin_lights()

    local cabinlight_1_pos = {x=0.0, y=1.0, z=1.0}
    local cabinlight_1_dir = {x=0,y=0,z=1}

    cabinlight_1 = vi:add_spotlight(cabinlight_1_pos,cabinlight_1_dir, {range=10,att0=1e-3,att1=0,att2=2e-3,umbra=PI,penumbra=0},{r=1,g=0,b=0})
    cabinlight_1:set_visibility(VIS.COCKPIT)
    cabinlight_1:set_intensity(0)
    cabinlight_1:activate(true)

    local cabinlight_2_pos = {x=0.0, y=1.0, z=1.0}
    local cabinlight_2_dir = {x=0,y=0,z=-1}

    cabinlight_2 = vi:add_spotlight(cabinlight_2_pos,cabinlight_2_dir, {range=10,att0=1e-3,att1=0,att2=2e-3,umbra=PI,penumbra=0},{r=1,g=0,b=0})
    cabinlight_2:set_visibility(VIS.COCKPIT)
    cabinlight_2:set_intensity(0)
    cabinlight_2:activate(true)

end

Code:
function set_pretty.cabin_lights()

    cabinlight_1:set_intensity(cabin_light_level)
    cabinlight_2:set_intensity(cabin_light_level)

end

All is well and good...until I switch on exterior lights (three navigation light beacons and a white spotlight). When I do this, the forward cabin light (cabinlight_1) no longer illuminates the instrument panel:

Screenshot at 2025-02-10 15-12-19.png
Screenshot at 2025-02-10 15-12-31.png
The aft cabin light (cabinlight_2) remains illuminated.
Screenshot at 2025-02-10 15-13-28.png

cabinlight_1:is_active() returns true before, during, and after switching on the exterior lights (which is correct, it should always be on).

Its intensity is set at the same time as for cabinlight_2, and the cabin lights are not associated with the exterior light switch in any way.

I don't know that this is a Lua issue or something more fundamental to the lightemitter class that I am not understanding, or a bug.

I am using Orbiter 2024 using Orbiter_NG.exe.
 
AFAIK, if there are more lights than the light limit, only the "most significant" ones will be shown. Meaning that if a big light is turned on, the smaller ones in the zone will go off.
 
AFAIK, if there are more lights than the light limit, only the "most significant" ones will be shown. Meaning that if a big light is turned on, the smaller ones in the zone will go off.
What is the limit? Is it based on just the lightemitters or lightemittters + beacons, or something else?
 
What is the limit? Is it based on just the lightemitters or lightemittters + beacons, or something else?
Limit is 8, but by default it's set to 4. You can change this by clicking on the Advanced button on the Video tab.
 
Isn't there an omnidirectional mode? Could save on your light budget a bit.
 
Isn't there an omnidirectional mode? Could save on your light budget a bit.
I forgot that there is also a point light emitter in addition to the spotlight emitter. Point lights are omni-directional, where spotlights are directional and have aperture limits of +PI to -PI radians. I replaced the two spotlights with a single point light.
 
Back
Top