- Messages
- 5,541
- Country
-
Hi all.
A long post concerning the use of lights in scenery:
As far as the sim goes, there are only 2 types of scenery lights… a spotlight and a glowing ball:
BGL_LIGHT LIGHT_LANDING, 0.0, 0.0, 0.0, 0, 0.0, 0.0, 000FFFFFFh, 0.0, 0.0, 0.0; 000FFFFFFh is the color ( white in this case )
BGL_LIGHT LIGHT_NAV, 0.0, 0.0, 0.0, 0, 0.0, 0.0, 000FFFFFFh, 0.0, 0.0, 0.0; the color is the only variable used
The difference between strobe, beacon, and nav is that strobe and beacon have conditional display added. There appears to be no difference between taxi and landing lights. Color is the only variable used.
Taxi and landing lights point horizontally, and to the north by default. That can be changed by a transformation in the MDL to have them pitched 89.99* down.
Here’s a downward pointing spotlight. I made the transform for -89.99 degrees along the X axis, pitching it downward. Taxi could have been the type, with no difference in the sim:
Here is a nav light:
Here is a strobe light. Note that the type could be NAV or STROBE:
Here is a beacon. Again, NAV could replace BEACON:
All these codes can be compiled with BGLC_9 to make MDLs of scenery lights. The color/brightness can be altered by changing the hex numbers for rgb. In the case of the downward pointing spotlights, the placement altitude affects the size of the light circle… a tighter spot needs less altitude for placement. The bitmap for the spot is fixed by the sim.
Dick
A long post concerning the use of lights in scenery:
As far as the sim goes, there are only 2 types of scenery lights… a spotlight and a glowing ball:
BGL_LIGHT LIGHT_LANDING, 0.0, 0.0, 0.0, 0, 0.0, 0.0, 000FFFFFFh, 0.0, 0.0, 0.0; 000FFFFFFh is the color ( white in this case )
BGL_LIGHT LIGHT_NAV, 0.0, 0.0, 0.0, 0, 0.0, 0.0, 000FFFFFFh, 0.0, 0.0, 0.0; the color is the only variable used
The difference between strobe, beacon, and nav is that strobe and beacon have conditional display added. There appears to be no difference between taxi and landing lights. Color is the only variable used.
Taxi and landing lights point horizontally, and to the north by default. That can be changed by a transformation in the MDL to have them pitched 89.99* down.
Here’s a downward pointing spotlight. I made the transform for -89.99 degrees along the X axis, pitching it downward. Taxi could have been the type, with no difference in the sim:
Code:
db 'R','I','F','F' ; RIFF file identifier
dd bgl_data_end - $ - 4 ; size of RIFF data
db 'M','D','L','9' ; file identifire (FS9 model)
db 'M','D','L','H'
dd visual_model_header_end - $ - 4
dd visual_model_header_end - $ - 4
dd 0
dd 0
dd 2
dd 0
dd 0
dd 156
db 'F','S','8','0'
dd 2304
visual_model_header_end label dword
db 'I','S','F','T'
dd ver_end - $ - 4
db "BGLC_9",0
ver_end label word
bounding_box_riff_start label word
db 'B','B','O','X'
dd bounding_box_riff_end - $ - 4
real4 -100.000, -100.000, -100.000
real4 100.000, 100.000, 100.000
bounding_box_riff_end label word
model_outside label BGLCODE
model_shadow label BGLCODE
model_inside label BGLCODE
exterior_riff_start_0 label BGLCODE
db 'E','X','T','E'
dd exterior_riff_end_0 - $ - 4
LOD_0L label BGLCODE
bgl_riff_start_Light01 label BGLCODE
db 'B','G','L',' '
dd bgl_riff_end_Light01 - $ - 4
LOD_0_Light01 label BGLCODE
; Alpha
LIGHT_TAXI_beta_Alpha label BGLCODE
; Node 1 - MasterScale transform:
BGL_SET_MATRIX_INDIRECT 0
BGL_CALL_32 LIGHT_TAXI_beta_MasterScale_1 ; Node 1 - MasterScale
BGL_END
BGL_RETURN
LIGHT_TAXI_beta_MasterScale_1 label BGLCODE
; Node 2 - MasterUnitConversion transform:
BGL_SET_MATRIX_INDIRECT 1
; Node 3 - RotateAroundX transform:
BGL_SET_MATRIX_INDIRECT 2
; Node 4 - LightCone transform:
BGL_SET_MATRIX_INDIRECT 3
BGL_LIGHT LIGHT_TAXI, 0.0, 0.0, 0.0, 0, 0.0, 0.0, 0FFABABABh, 0.000000, 0.000000, 0.000000 ; Color is AB AB AB (rgb)
BGL_RETURN
bgl_riff_end_Light01 label BGLCODE
;
; STATIC ANIMATION BLOCK
;
static_matrix_list_riff_start_Light01 label word
db 'T','R','A','N'
dd static_matrix_list_riff_end_Light01 - $ - 4
; Static matrix parameters for transform: 0
real4 0.000997, 0.000000, 0.000000, 0.000000
real4 0.000000, 0.000997, 0.000000, 0.000000
real4 0.000000, 0.000000, 0.000997, 0.000000
real4 0.000000, 0.000000, 0.000000, 1.000000
; Static matrix parameters for transform: 1
real4 1024.000000, 0.000000, 0.000000, 0.000000
real4 0.000000, 1024.000000, 0.000000, 0.000000
real4 0.000000, 0.000000, 1024.000000, 0.000000
real4 0.000000, 0.000000, 0.000000, 1.000000
; Static matrix parameters for transform: 2
real4 1.000000, 0.000000, 0.000000, 0.000000
real4 0.000000, 0.000000, 1.000000, 0.000000
real4 0.000000, -1.000000, 0.000000, 0.000000
real4 0.000000, 0.000000, 0.000000, 1.000000
; Static matrix parameters for transform: 3
real4 1.000000, 0.000000, 0.000000, 0.000000
real4 0.000000, 1.000000, 0.000000, 0.000000
real4 0.000000, -0.000001, 1.000000, 0.000000
real4 0.000000, 0.000000, 0.000000, 1.000000
static_matrix_list_riff_end_Light01 label word
;
; ANIMATION PARAMETER BLOCK
;
animation_parameters_riff_start_Light01 label word
db 'A','N','I','P'
dd animation_parameters_riff_end_Light01 - $ - 4
animation_parameters_riff_end_Light01 label word
;
; ANIMATION COMMAND BLOCK
;
animation_commands_riff_start_Light01 label word
db 'A','N','I','C'
dd animation_commands_riff_end_Light01 - $ - 4
; Animation command for transform: 0 output index: 0
bgl_animation_command_start_LIGHT_LANDING_beta_0 label BGLCODE
BGL_TRANSFORM_INDIRECT 0, 0
bgl_animation_command_end_LIGHT_LANDING_beta_0 label BGLCODE
; Animation command for transform: 1 output index: 1
bgl_animation_command_start_LIGHT_LANDING_beta_1 label BGLCODE
BGL_TRANSFORM_INDIRECT 1, 1
bgl_animation_command_end_LIGHT_LANDING_beta_1 label BGLCODE
; Animation command for transform: 2 output index: 2
bgl_animation_command_start_LIGHT_LANDING_beta_2 label BGLCODE
BGL_TRANSFORM_INDIRECT 2, 2
bgl_animation_command_end_LIGHT_LANDING_beta_2 label BGLCODE
; Animation command for transform: 3 output index: 3
bgl_animation_command_start_LIGHT_LANDING_beta_3 label BGLCODE
BGL_TRANSFORM_INDIRECT 3, 3
bgl_animation_command_end_LIGHT_LANDING_beta_3 label BGLCODE
animation_commands_riff_end_Light01 label word
;
; SCENE GRAPH RIFF BLOCK
;
scene_graph_riff_start_Light01 label word
db 'S','C','E','N'
dd scene_graph_riff_end_Light01 - $ - 4
dw 4
bgl_scene_graph_entry_LIGHT_LANDING_beta_0 label byte
BGL_SCENEGRAPH_ENTRY 0, 1, -1, bgl_animation_command_end_LIGHT_LANDING_beta_0 - bgl_animation_command_start_LIGHT_LANDING_beta_0, bgl_animation_command_start_LIGHT_LANDING_beta_0 - bgl_scene_graph_entry_LIGHT_LANDING_beta_0
bgl_scene_graph_entry_LIGHT_LANDING_beta_1 label byte
BGL_SCENEGRAPH_ENTRY 1, 2, -1, bgl_animation_command_end_LIGHT_LANDING_beta_1 - bgl_animation_command_start_LIGHT_LANDING_beta_1, bgl_animation_command_start_LIGHT_LANDING_beta_1 - bgl_scene_graph_entry_LIGHT_LANDING_beta_1
bgl_scene_graph_entry_LIGHT_LANDING_beta_2 label byte
BGL_SCENEGRAPH_ENTRY 2, 3, -1, bgl_animation_command_end_LIGHT_LANDING_beta_2 - bgl_animation_command_start_LIGHT_LANDING_beta_2, bgl_animation_command_start_LIGHT_LANDING_beta_2 - bgl_scene_graph_entry_LIGHT_LANDING_beta_2
bgl_scene_graph_entry_LIGHT_LANDING_beta_3 label byte
BGL_SCENEGRAPH_ENTRY 3, -1, -1, bgl_animation_command_end_LIGHT_LANDING_beta_3 - bgl_animation_command_start_LIGHT_LANDING_beta_3, bgl_animation_command_start_LIGHT_LANDING_beta_3 - bgl_scene_graph_entry_LIGHT_LANDING_beta_3
scene_graph_riff_end_Light01 label word
exterior_riff_end_0 label BGLCODE
shadow_riff_start_0 label BGLCODE
db 'S','H','A','D'
dd shadow_riff_end_0 - $ - 4
SHADOW_0L label BGLCODE
Kill_Shadow_top label BGLCODE
bgl_riff_start_Kill_Shadow label BGLCODE
db 'B','G','L',' '
dd bgl_riff_end_Kill_Shadow - $ - 4
LOD_0_Kill_Shadow label BGLCODE
BGL_END
BGL_RETURN
bgl_riff_end_Kill_Shadow label BGLCODE
shadow_riff_end_0 label BGLCODE
bgl_data_end label BGLCODE
Here is a nav light:
Code:
db 'R','I','F','F' ; RIFF file identifier
dd bgl_data_end - $ - 4 ; size of RIFF data
db 'M','D','L','9' ; file identifire (FS9 model)
db 'M','D','L','H'
dd visual_model_header_end - $ - 4
dd visual_model_header_end - $ - 4
dd 0
dd 0
dd 2
dd 0
dd 0
dd 156
db 'F','S','8','0'
dd 2304
visual_model_header_end label dword
db 'I','S','F','T'
dd ver_end - $ - 4
db "BGLC_9",0
ver_end label word
bounding_box_riff_start label word
db 'B','B','O','X'
dd bounding_box_riff_end - $ - 4
real4 -100.000, -100.000, -100.000
real4 100.000, 100.000, 100.000
bounding_box_riff_end label word
model_outside label BGLCODE
model_shadow label BGLCODE
model_inside label BGLCODE
exterior_riff_start_0 label BGLCODE
db 'E','X','T','E'
dd exterior_riff_end_0 - $ - 4
LOD_0L label BGLCODE
LIGHT_NAV_beta_top label BGLCODE
bgl_riff_start_LIGHT_NAV_beta label BGLCODE
db 'B','G','L',' '
dd bgl_riff_end_LIGHT_NAV_beta - $ - 4
LOD_0_LIGHT_NAV_beta label BGLCODE
; Alpha
LIGHT_NAV_beta_Alpha label BGLCODE
BGL_CALL_32 LIGHT_NAV_beta_MasterScale_1 ; Node 1 - MasterScale
BGL_END
BGL_RETURN
LIGHT_NAV_beta_MasterScale_1 label BGLCODE
BGL_LIGHT LIGHT_NAV, 0.0, 0.0, 0.0, 0, 0.0, 0.0, 0FFABABABh, 0.000000, 0.000000, 0.000000 ; Color is AB AB AB (rgb)
BGL_RETURN
bgl_riff_end_LIGHT_NAV_beta label BGLCODE
exterior_riff_end_0 label BGLCODE
shadow_riff_start_0 label BGLCODE
db 'S','H','A','D'
dd shadow_riff_end_0 - $ - 4
SHADOW_0L label BGLCODE
Kill_Shadow_top label BGLCODE
bgl_riff_start_Kill_Shadow label BGLCODE
db 'B','G','L',' '
dd bgl_riff_end_Kill_Shadow - $ - 4
LOD_0_Kill_Shadow label BGLCODE
BGL_END
BGL_RETURN
bgl_riff_end_Kill_Shadow label BGLCODE
shadow_riff_end_0 label BGLCODE
bgl_data_end label BGLCODE
Here is a strobe light. Note that the type could be NAV or STROBE:
Code:
db 'R','I','F','F' ; RIFF file identifier
dd bgl_data_end - $ - 4 ; size of RIFF data
db 'M','D','L','9' ; file identifire (FS9 model)
db 'M','D','L','H'
dd visual_model_header_end - $ - 4
dd visual_model_header_end - $ - 4
dd 0
dd 0
dd 2
dd 0
dd 0
dd 156
db 'F','S','8','0'
dd 2304
visual_model_header_end label dword
db 'I','S','F','T'
dd ver_end - $ - 4
db "BGLC_9",0
ver_end label word
bounding_box_riff_start label word
db 'B','B','O','X'
dd bounding_box_riff_end - $ - 4
real4 -100.000, -100.000, -100.000
real4 100.000, 100.000, 100.000
bounding_box_riff_end label word
model_outside label BGLCODE
model_shadow label BGLCODE
model_inside label BGLCODE
exterior_riff_start_0 label BGLCODE
db 'E','X','T','E'
dd exterior_riff_end_0 - $ - 4
LOD_0L label BGLCODE
LIGHT_STROBE_beta_top label BGLCODE
bgl_riff_start_LIGHT_STROBE_beta label BGLCODE
db 'B','G','L',' '
dd bgl_riff_end_LIGHT_STROBE_beta - $ - 4
LOD_0_LIGHT_STROBE_beta label BGLCODE
; Alpha
LIGHT_STROBE_beta_Alpha label BGLCODE
BGL_CALL_32 LIGHT_STROBE_beta_MasterScale_1 ; Node 1 - MasterScale
BGL_END
BGL_RETURN
LIGHT_STROBE_beta_MasterScale_1 label BGLCODE
VAR_BASE_OVERRIDE VAR_BASE_GLOBAL
IFMSK nolgt_2, beacnt, 00002h
BGL_LIGHT LIGHT_STROBE, 0.0, 0.0, 0.0, 0, 0.0, 0.0, 0FFABABABh, 0.000000, 0.000000, 0.000000 ; Color is AB AB AB (rgb)
nolgt_2 label BGLCODE
BGL_RETURN
bgl_riff_end_LIGHT_STROBE_beta label BGLCODE
exterior_riff_end_0 label BGLCODE
shadow_riff_start_0 label BGLCODE
db 'S','H','A','D'
dd shadow_riff_end_0 - $ - 4
SHADOW_0L label BGLCODE
Kill_Shadow_top label BGLCODE
bgl_riff_start_Kill_Shadow label BGLCODE
db 'B','G','L',' '
dd bgl_riff_end_Kill_Shadow - $ - 4
LOD_0_Kill_Shadow label BGLCODE
BGL_END
BGL_RETURN
bgl_riff_end_Kill_Shadow label BGLCODE
shadow_riff_end_0 label BGLCODE
bgl_data_end label BGLCODE
Here is a beacon. Again, NAV could replace BEACON:
Code:
db 'R','I','F','F' ; RIFF file identifier
dd bgl_data_end - $ - 4 ; size of RIFF data
db 'M','D','L','9' ; file identifire (FS9 model)
db 'M','D','L','H'
dd visual_model_header_end - $ - 4
dd visual_model_header_end - $ - 4
dd 0
dd 0
dd 2
dd 0
dd 0
dd 156
db 'F','S','8','0'
dd 2304
visual_model_header_end label dword
db 'I','S','F','T'
dd ver_end - $ - 4
db "BGLC_9",0
ver_end label word
bounding_box_riff_start label word
db 'B','B','O','X'
dd bounding_box_riff_end - $ - 4
real4 -100.000, -100.000, -100.000
real4 100.000, 100.000, 100.000
bounding_box_riff_end label word
model_outside label BGLCODE
model_shadow label BGLCODE
model_inside label BGLCODE
exterior_riff_start_0 label BGLCODE
db 'E','X','T','E'
dd exterior_riff_end_0 - $ - 4
LOD_0L label BGLCODE
LIGHT_BEACON_beta_top label BGLCODE
bgl_riff_start_LIGHT_BEACON_beta label BGLCODE
db 'B','G','L',' '
dd bgl_riff_end_LIGHT_BEACON_beta - $ - 4
LOD_0_LIGHT_BEACON_beta label BGLCODE
; Alpha
LIGHT_BEACON_beta_Alpha label BGLCODE
BGL_CALL_32 LIGHT_BEACON_beta_MasterScale_1 ; Node 1 - MasterScale
BGL_END
BGL_RETURN
LIGHT_BEACON_beta_MasterScale_1 label BGLCODE
VAR_BASE_OVERRIDE VAR_BASE_GLOBAL
IFMSK lgt_1, becon4, 0c000h
BGL_JUMP_32 nolgt_1
lgt_1 label BGLCODE
BGL_LIGHT LIGHT_BEACON, 0.0, 0.0, 0.0, 0, 0.0, 0.0, 0FFF8F3ABh, 0.000000, 0.000000, 0.000000 ; source poly num = 1
nolgt_1 label BGLCODE
BGL_RETURN
bgl_riff_end_LIGHT_BEACON_beta label BGLCODE
exterior_riff_end_0 label BGLCODE
shadow_riff_start_0 label BGLCODE
db 'S','H','A','D'
dd shadow_riff_end_0 - $ - 4
SHADOW_0L label BGLCODE
Kill_Shadow_top label BGLCODE
bgl_riff_start_Kill_Shadow label BGLCODE
db 'B','G','L',' '
dd bgl_riff_end_Kill_Shadow - $ - 4
LOD_0_Kill_Shadow label BGLCODE
BGL_END
BGL_RETURN
bgl_riff_end_Kill_Shadow label BGLCODE
shadow_riff_end_0 label BGLCODE
bgl_data_end label BGLCODE
All these codes can be compiled with BGLC_9 to make MDLs of scenery lights. The color/brightness can be altered by changing the hex numbers for rgb. In the case of the downward pointing spotlights, the placement altitude affects the size of the light circle… a tighter spot needs less altitude for placement. The bitmap for the spot is fixed by the sim.
Dick