diff --git a/Effects/runway.eff b/Effects/runway.eff
index 7664f71e6..4cad33165 100644
--- a/Effects/runway.eff
+++ b/Effects/runway.eff
@@ -78,6 +78,46 @@
1.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -169,6 +209,7 @@
Shaders/hazes.frag
Shaders/secondary_lights.frag
Shaders/filters-ALS.frag
+ Shaders/lightspot-ALS.frag
visibility
@@ -270,6 +311,7 @@
float
+
view_pitch_offset
@@ -301,6 +343,201 @@
float
+
+ eyerel_x1
+ float
+
+
+
+ eyerel_y1
+ float
+
+
+
+ eyerel_z1
+ float
+
+
+
+ lightspot_project1
+ float
+
+
+
+ lightspot_dir1
+ float
+
+
+
+ lightspot_size1
+ float
+
+
+
+ lightspot_r1
+ float
+
+
+
+ lightspot_g1
+ float
+
+
+
+ lightspot_b1
+ float
+
+
+
+ eyerel_x2
+ float
+
+
+
+ eyerel_y2
+ float
+
+
+
+ eyerel_z2
+ float
+
+
+
+ lightspot_project2
+ float
+
+
+
+ lightspot_dir2
+ float
+
+
+
+ lightspot_size2
+ float
+
+
+
+ lightspot_r2
+ float
+
+
+
+ lightspot_g2
+ float
+
+
+
+ lightspot_b2
+ float
+
+
+
+ eyerel_x3
+ float
+
+
+
+ eyerel_y3
+ float
+
+
+
+ eyerel_z3
+ float
+
+
+
+ lightspot_size3
+ float
+
+
+
+ lightspot_r3
+ float
+
+
+
+ lightspot_g3
+ float
+
+
+
+ lightspot_b3
+ float
+
+
+
+ eyerel_x4
+ float
+
+
+
+ eyerel_y4
+ float
+
+
+
+ eyerel_z4
+ float
+
+
+
+ lightspot_size4
+ float
+
+
+
+ lightspot_r4
+ float
+
+
+
+ lightspot_g4
+ float
+
+
+
+ lightspot_b4
+ float
+
+
+
+ eyerel_x5
+ float
+
+
+
+ eyerel_y5
+ float
+
+
+
+ eyerel_z5
+ float
+
+
+
+ lightspot_size5
+ float
+
+
+
+ lightspot_r5
+ float
+
+
+
+ lightspot_g5
+ float
+
+
+
+ lightspot_b5
+ float
+
+
gamma
@@ -573,6 +810,11 @@
int
+
+ num_lightspots
+ int
+
+
overlay_flag
int
diff --git a/Shaders/lightspot-ALS.frag b/Shaders/lightspot-ALS.frag
index cfdae95fb..5862eff32 100644
--- a/Shaders/lightspot-ALS.frag
+++ b/Shaders/lightspot-ALS.frag
@@ -40,10 +40,19 @@ uniform float lightspot_size3;
uniform float lightspot_size4;
uniform float lightspot_size5;
+uniform int num_lightspots;
+
vec3 lightspot(vec3 relPos)
{
+if (num_lightspots == 0)
+ {
+ return vec3 (0.0, 0.0, 0.0);
+ }
+
+// first projectable spot
+
vec3 eye_rel = vec3 (eyerel_x1, eyerel_y1, eyerel_z1);
vec3 difference_vec = relPos - eye_rel;
@@ -52,19 +61,47 @@ mat2 rotMat = mat2 (cos(lightspot_dir1), sin(lightspot_dir1), -sin(lightspot_dir
difference_vec.xy = rotMat * difference_vec.xy;
difference_vec.x/= (1.0 + lightspot_project1);
-
-float lightspot_arg = (1.0 - smoothstep(5.0, 15.0, length(difference_vec))) * (1.0 - 0.5* smoothstep(5.0, 15.0/(1.0+lightspot_project1), difference_vec.x));
+float lightspot_arg = (1.0 - smoothstep(lightspot_size1/3.0, lightspot_size1, length(difference_vec))) * (1.0 - 0.5* smoothstep(lightspot_size1/3.0, lightspot_size1/(1.0+lightspot_project1), difference_vec.x));
vec3 lightspot_color = vec3 (lightspot_r1,lightspot_g1, lightspot_b1 ) * lightspot_arg;
+// second projectable spot
+
eye_rel = vec3 (eyerel_x2, eyerel_y2, eyerel_z2);
-lightspot_arg = (1.0 - smoothstep(0.0, 5.0, length(relPos - eye_rel)));
+difference_vec = relPos - eye_rel;
+
+rotMat = mat2 (cos(lightspot_dir2), sin(lightspot_dir2), -sin(lightspot_dir2), cos(lightspot_dir2));
+
+difference_vec.xy = rotMat * difference_vec.xy;
+difference_vec.x/= (1.0 + lightspot_project2);
+
+lightspot_arg = (1.0 - smoothstep(lightspot_size2/3.0, lightspot_size2, length(relPos - eye_rel)));
+
lightspot_color += vec3 (lightspot_r2,lightspot_g2, lightspot_b2 ) * lightspot_arg;
+if (num_lightspots < 3)
+ {
+ return lightspot_color ;
+ }
+
+// spherical spot
+
eye_rel = vec3 (eyerel_x3, eyerel_y3, eyerel_z3);
-lightspot_arg = (1.0 - smoothstep(0.0, 5.0, length(relPos - eye_rel)));
+lightspot_arg = (1.0 - smoothstep(lightspot_size3/3.0, lightspot_size3, length(relPos - eye_rel)));
lightspot_color += vec3 (lightspot_r3,lightspot_g3, lightspot_b3 ) * lightspot_arg;
+// spherical spot
+
+eye_rel = vec3 (eyerel_x4, eyerel_y4, eyerel_z4);
+lightspot_arg = (1.0 - smoothstep(lightspot_size4/3.0, lightspot_size4, length(relPos - eye_rel)));
+lightspot_color += vec3 (lightspot_r4,lightspot_g4, lightspot_b4 ) * lightspot_arg;
+
+// spherical spot
+
+eye_rel = vec3 (eyerel_x5, eyerel_y5, eyerel_z5);
+lightspot_arg = (1.0 - smoothstep(lightspot_size5/3.0, lightspot_size5, length(relPos - eye_rel)));
+lightspot_color += vec3 (lightspot_r5,lightspot_g5, lightspot_b5 ) * lightspot_arg;
+
return lightspot_color;
}
diff --git a/Shaders/runway-ALS.frag b/Shaders/runway-ALS.frag
index 51d952aba..3728c31f2 100644
--- a/Shaders/runway-ALS.frag
+++ b/Shaders/runway-ALS.frag
@@ -67,6 +67,7 @@ float rayleigh_in_func(in float dist, in float air_pollution, in float avisibili
vec3 searchlight();
vec3 landing_light(in float offset, in float offsetv);
+vec3 lightspot(in vec3 relPos);
vec3 rayleigh_out_shift(in vec3 color, in float outscatter);
vec3 get_hazeColor(in float light_arg);
vec3 filter_combined (in vec3 color) ;
@@ -333,7 +334,8 @@ if ((dist < 5000.0)&& (quality_level > 3) && (wetness>0.0))
{
secondary_light += landing_light(landing_light2_offset, landing_light3_offset);
}
- color.rgb +=secondary_light * light_distance_fading(dist);
+
+ color.rgb +=secondary_light * light_distance_fading(dist) + lightspot(relPos);
fragColor = color * texel + specular;
diff --git a/preferences.xml b/preferences.xml
index bf4db1ec6..f09f63466 100644
--- a/preferences.xml
+++ b/preferences.xml
@@ -293,6 +293,49 @@ Started September 2000 by David Megginson, david@megginson.com
0.0
0.0
0
+ 0
+
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+ 0.0
+
+
false