Vertical offset for ALS landing lights by Wayne Bragg
This commit is contained in:
parent
354b0947e0
commit
def0ee20d4
30 changed files with 179 additions and 101 deletions
|
@ -420,6 +420,11 @@
|
|||
<type>float</type>
|
||||
<value><use>landing_light2_offset</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>landing_light3_offset</name>
|
||||
<type>float</type>
|
||||
<value><use>landing_light3_offset</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>cloudpos1_x</name>
|
||||
<type>float</type>
|
||||
|
|
|
@ -250,6 +250,11 @@
|
|||
<type>float</type>
|
||||
<value><use>landing_light2_offset</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>landing_light3_offset</name>
|
||||
<type>float</type>
|
||||
<value><use>landing_light3_offset</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>cloudpos1_x</name>
|
||||
<type>float</type>
|
||||
|
|
|
@ -325,7 +325,12 @@
|
|||
<type>float</type>
|
||||
<value><use>landing_light2_offset</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<uniform>
|
||||
<name>landing_light3_offset</name>
|
||||
<type>float</type>
|
||||
<value><use>landing_light3_offset</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>cloudpos1_x</name>
|
||||
<type>float</type>
|
||||
<value><use>cloudpos1_x</use></value>
|
||||
|
|
|
@ -914,6 +914,11 @@ please see Docs/README.model-combined.eff for documentation
|
|||
<type>float</type>
|
||||
<value><use>landing_light2_offset</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>landing_light3_offset</name>
|
||||
<type>float</type>
|
||||
<value><use>landing_light3_offset</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>cloudpos1_x</name>
|
||||
<type>float</type>
|
||||
|
|
|
@ -20,24 +20,25 @@
|
|||
<ground_scattering><use>/environment/surface/scattering</use></ground_scattering>
|
||||
<terminator><use>/environment/terminator-relative-position-m</use></terminator>
|
||||
<terrain_alt><use>/environment/mean-terrain-elevation-m</use></terrain_alt>
|
||||
<overcast><use>/rendering/scene/overcast</use></overcast>
|
||||
<eye_alt><use>/sim/rendering/eye-altitude-m</use></eye_alt>
|
||||
<cloud_self_shading><use>/environment/cloud-self-shading</use></cloud_self_shading>
|
||||
<moonlight><use>/environment/moonlight</use></moonlight>
|
||||
<overcast><use>/rendering/scene/overcast</use></overcast>
|
||||
<eye_alt><use>/sim/rendering/eye-altitude-m</use></eye_alt>
|
||||
<cloud_self_shading><use>/environment/cloud-self-shading</use></cloud_self_shading>
|
||||
<moonlight><use>/environment/moonlight</use></moonlight>
|
||||
<fogtype><use>/sim/rendering/shaders/skydome</use></fogtype>
|
||||
<air_pollution><use>/environment/air-pollution-norm</use></air_pollution>
|
||||
<air_pollution><use>/environment/air-pollution-norm</use></air_pollution>
|
||||
<display_xsize><use>/sim/startup/xsize</use></display_xsize>
|
||||
<display_ysize><use>/sim/startup/ysize</use></display_ysize>
|
||||
<view_pitch_offset><use>/sim/current-view/pitch-offset-deg</use></view_pitch_offset>
|
||||
<view_heading_offset><use>/sim/current-view/heading-offset-deg</use></view_heading_offset>
|
||||
<view_fov><use>/sim/current-view/field-of-view</use></view_fov>
|
||||
<use_searchlight><use>/sim/rendering/als-secondary-lights/use-searchlight</use></use_searchlight>
|
||||
<use_landing_light><use>/sim/rendering/als-secondary-lights/use-landing-light</use></use_landing_light>
|
||||
<use_alt_landing_light><use>/sim/rendering/als-secondary-lights/use-alt-landing-light</use></use_alt_landing_light>
|
||||
<landing_light1_offset><use>/sim/rendering/als-secondary-lights/landing-light1-offset-deg</use></landing_light1_offset>
|
||||
<landing_light2_offset><use>/sim/rendering/als-secondary-lights/landing-light2-offset-deg</use></landing_light2_offset>
|
||||
<display_ysize><use>/sim/startup/ysize</use></display_ysize>
|
||||
<view_pitch_offset><use>/sim/current-view/pitch-offset-deg</use></view_pitch_offset>
|
||||
<view_heading_offset><use>/sim/current-view/heading-offset-deg</use></view_heading_offset>
|
||||
<view_fov><use>/sim/current-view/field-of-view</use></view_fov>
|
||||
<use_searchlight><use>/sim/rendering/als-secondary-lights/use-searchlight</use></use_searchlight>
|
||||
<use_landing_light><use>/sim/rendering/als-secondary-lights/use-landing-light</use></use_landing_light>
|
||||
<use_alt_landing_light><use>/sim/rendering/als-secondary-lights/use-alt-landing-light</use></use_alt_landing_light>
|
||||
<landing_light1_offset><use>/sim/rendering/als-secondary-lights/landing-light1-offset-deg</use></landing_light1_offset>
|
||||
<landing_light2_offset><use>/sim/rendering/als-secondary-lights/landing-light2-offset-deg</use></landing_light2_offset>
|
||||
<landing_light3_offset><use>/sim/rendering/als-secondary-lights/landing-light3-offset-deg</use></landing_light3_offset>
|
||||
<quality_level><use>/sim/rendering/shaders/landmass</use></quality_level>
|
||||
<tquality_level><use>/sim/rendering/shaders/transition</use></tquality_level>
|
||||
<tquality_level><use>/sim/rendering/shaders/transition</use></tquality_level>
|
||||
<!-- END fog include -->
|
||||
</parameters>
|
||||
|
||||
|
@ -198,6 +199,11 @@
|
|||
<type>float</type>
|
||||
<value><use>landing_light2_offset</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>landing_light3_offset</name>
|
||||
<type>float</type>
|
||||
<value><use>landing_light3_offset</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>texture</name>
|
||||
<type>sampler-2d</type>
|
||||
|
|
|
@ -289,6 +289,11 @@
|
|||
<type>float</type>
|
||||
<value><use>landing_light2_offset</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>landing_light3_offset</name>
|
||||
<type>float</type>
|
||||
<value><use>landing_light3_offset</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>cloudpos1_x</name>
|
||||
<type>float</type>
|
||||
|
|
|
@ -292,6 +292,11 @@
|
|||
<type>float</type>
|
||||
<value><use>landing_light2_offset</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>landing_light3_offset</name>
|
||||
<type>float</type>
|
||||
<value><use>landing_light3_offset</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>cloudpos1_x</name>
|
||||
<type>float</type>
|
||||
|
@ -507,20 +512,20 @@
|
|||
<type>int</type>
|
||||
<value><use>tquality_level</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>use_searchlight</name>
|
||||
<type>int</type>
|
||||
<value> <use>use_searchlight</use></value>
|
||||
<uniform>
|
||||
<name>use_searchlight</name>
|
||||
<type>int</type>
|
||||
<value><use>use_searchlight</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>use_landing_light</name>
|
||||
<type>int</type>
|
||||
<value> <use>use_landing_light</use></value>
|
||||
<name>use_landing_light</name>
|
||||
<type>int</type>
|
||||
<value><use>use_landing_light</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>use_alt_landing_light</name>
|
||||
<type>int</type>
|
||||
<value> <use>use_alt_landing_light</use></value>
|
||||
<name>use_alt_landing_light</name>
|
||||
<type>int</type>
|
||||
<value><use>use_alt_landing_light</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>display_xsize</name>
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
<use_alt_landing_light><use>/sim/rendering/als-secondary-lights/use-alt-landing-light</use></use_alt_landing_light>
|
||||
<landing_light1_offset><use>/sim/rendering/als-secondary-lights/landing-light1-offset-deg</use></landing_light1_offset>
|
||||
<landing_light2_offset><use>/sim/rendering/als-secondary-lights/landing-light2-offset-deg</use></landing_light2_offset>
|
||||
<landing_light3_offset><use>/sim/rendering/als-secondary-lights/landing-light3-offset-deg</use></landing_light3_offset>
|
||||
<air_pollution><use>/environment/air-pollution-norm</use></air_pollution>
|
||||
</parameters>
|
||||
<technique n="8">
|
||||
|
@ -151,6 +152,11 @@
|
|||
<type>float</type>
|
||||
<value><use>landing_light2_offset</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>landing_light3_offset</name>
|
||||
<type>float</type>
|
||||
<value><use>landing_light3_offset</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>use_searchlight</name>
|
||||
<type>int</type>
|
||||
|
|
|
@ -127,6 +127,7 @@
|
|||
<use_alt_landing_light><use>/sim/rendering/als-secondary-lights/use-alt-landing-light</use></use_alt_landing_light>
|
||||
<landing_light1_offset><use>/sim/rendering/als-secondary-lights/landing-light1-offset-deg</use></landing_light1_offset>
|
||||
<landing_light2_offset><use>/sim/rendering/als-secondary-lights/landing-light2-offset-deg</use></landing_light2_offset>
|
||||
<landing_light3_offset><use>/sim/rendering/als-secondary-lights/landing-light3-offset-deg</use></landing_light3_offset>
|
||||
<quality_level><use>/sim/rendering/shaders/landmass</use></quality_level>
|
||||
<tquality_level><use>/sim/rendering/shaders/transition</use></tquality_level>
|
||||
<cloudpos1_x><use>/local-weather/cloud-shadows/cloudpos-x[0]</use></cloudpos1_x>
|
||||
|
@ -473,6 +474,11 @@
|
|||
<type>float</type>
|
||||
<value><use>landing_light2_offset</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>landing_light3_offset</name>
|
||||
<type>float</type>
|
||||
<value><use>landing_light3_offset</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>cloudpos1_x</name>
|
||||
<type>float</type>
|
||||
|
|
|
@ -56,6 +56,7 @@
|
|||
<use_alt_landing_light><use>/sim/rendering/als-secondary-lights/use-alt-landing-light</use></use_alt_landing_light>
|
||||
<landing_light1_offset><use>/sim/rendering/als-secondary-lights/landing-light1-offset-deg</use></landing_light1_offset>
|
||||
<landing_light2_offset><use>/sim/rendering/als-secondary-lights/landing-light2-offset-deg</use></landing_light2_offset>
|
||||
<landing_light3_offset><use>/sim/rendering/als-secondary-lights/landing-light3-offset-deg</use></landing_light3_offset>
|
||||
<cloudpos1_x><use>/local-weather/cloud-shadows/cloudpos-x[0]</use></cloudpos1_x>
|
||||
<cloudpos1_y><use>/local-weather/cloud-shadows/cloudpos-y[0]</use></cloudpos1_y>
|
||||
<cloudpos2_x><use>/local-weather/cloud-shadows/cloudpos-x[1]</use></cloudpos2_x>
|
||||
|
@ -259,6 +260,11 @@
|
|||
<type>float</type>
|
||||
<value><use>landing_light2_offset</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>landing_light3_offset</name>
|
||||
<type>float</type>
|
||||
<value><use>landing_light3_offset</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>cloudpos1_x</name>
|
||||
<type>float</type>
|
||||
|
@ -700,6 +706,11 @@
|
|||
<type>float</type>
|
||||
<value><use>landing_light2_offset</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>landing_light3_offset</name>
|
||||
<type>float</type>
|
||||
<value><use>landing_light3_offset</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>cloudpos1_x</name>
|
||||
<type>float</type>
|
||||
|
@ -1141,6 +1152,11 @@
|
|||
<type>float</type>
|
||||
<value><use>landing_light2_offset</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>landing_light3_offset</name>
|
||||
<type>float</type>
|
||||
<value><use>landing_light3_offset</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>cloudpos1_x</name>
|
||||
<type>float</type>
|
||||
|
|
|
@ -386,6 +386,11 @@
|
|||
<type>float</type>
|
||||
<value><use>landing_light2_offset</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>landing_light3_offset</name>
|
||||
<type>float</type>
|
||||
<value><use>landing_light3_offset</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>cloudpos1_x</name>
|
||||
<type>float</type>
|
||||
|
@ -851,6 +856,11 @@
|
|||
<type>float</type>
|
||||
<value><use>landing_light2_offset</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>landing_light3_offset</name>
|
||||
<type>float</type>
|
||||
<value><use>landing_light3_offset</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>cloudpos1_x</name>
|
||||
<type>float</type>
|
||||
|
|
|
@ -604,6 +604,11 @@
|
|||
<type>float</type>
|
||||
<value><use>landing_light2_offset</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>landing_light3_offset</name>
|
||||
<type>float</type>
|
||||
<value><use>landing_light3_offset</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>cloudpos1_x</name>
|
||||
<type>float</type>
|
||||
|
|
|
@ -596,7 +596,12 @@
|
|||
<name>landing_light2_offset</name>
|
||||
<type>float</type>
|
||||
<value><use>landing_light2_offset</use></value>
|
||||
</uniform>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>landing_light3_offset</name>
|
||||
<type>float</type>
|
||||
<value><use>landing_light3_offset</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>cloudpos1_x</name>
|
||||
<type>float</type>
|
||||
|
|
|
@ -49,6 +49,7 @@ uniform float uv_xoffset;
|
|||
uniform float uv_yoffset;
|
||||
uniform float landing_light1_offset;
|
||||
uniform float landing_light2_offset;
|
||||
uniform float landing_light3_offset;
|
||||
|
||||
uniform float dust_resistance;
|
||||
uniform float WindE;
|
||||
|
@ -87,7 +88,7 @@ float fog_backscatter(in float avisibility);
|
|||
vec3 rayleigh_out_shift(in vec3 color, in float outscatter);
|
||||
vec3 get_hazeColor(in float light_arg);
|
||||
vec3 searchlight();
|
||||
vec3 landing_light(in float offset);
|
||||
vec3 landing_light(in float offset, in float offsetv);
|
||||
|
||||
|
||||
|
||||
|
@ -437,11 +438,11 @@ if ((dist < 5000.0)&& (quality_level > 3) && (combined_wetness>0.0))
|
|||
}
|
||||
if (use_landing_light == 1)
|
||||
{
|
||||
secondary_light += landing_light(landing_light1_offset);
|
||||
secondary_light += landing_light(landing_light1_offset, landing_light3_offset);
|
||||
}
|
||||
if (use_alt_landing_light == 1)
|
||||
{
|
||||
secondary_light += landing_light(landing_light2_offset);
|
||||
secondary_light += landing_light(landing_light2_offset, landing_light3_offset);
|
||||
}
|
||||
color.rgb +=secondary_light * light_distance_fading(dist);
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ uniform float air_pollution;
|
|||
uniform float season;
|
||||
uniform float landing_light1_offset;
|
||||
uniform float landing_light2_offset;
|
||||
uniform float landing_light3_offset;
|
||||
|
||||
uniform int quality_level;
|
||||
uniform int tquality_level;
|
||||
|
@ -68,7 +69,7 @@ float fog_backscatter(in float avisibility);
|
|||
vec3 rayleigh_out_shift(in vec3 color, in float outscatter);
|
||||
vec3 get_hazeColor(in float light_arg);
|
||||
vec3 searchlight();
|
||||
vec3 landing_light(in float offset);
|
||||
vec3 landing_light(in float offset, in float offsetv);
|
||||
|
||||
|
||||
|
||||
|
@ -294,11 +295,11 @@ if (quality_level > 3)
|
|||
}
|
||||
if (use_landing_light == 1)
|
||||
{
|
||||
secondary_light += landing_light(landing_light1_offset);
|
||||
secondary_light += landing_light(landing_light1_offset, landing_light3_offset);
|
||||
}
|
||||
if (use_alt_landing_light == 1)
|
||||
{
|
||||
secondary_light += landing_light(landing_light2_offset);
|
||||
secondary_light += landing_light(landing_light2_offset, landing_light3_offset);
|
||||
}
|
||||
color.rgb +=secondary_light * light_distance_fading(dist);
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@ uniform float snow_thickness_factor;
|
|||
uniform float cloud_self_shading;
|
||||
uniform float landing_light1_offset;
|
||||
uniform float landing_light2_offset;
|
||||
uniform float landing_light3_offset;
|
||||
uniform float air_pollution;
|
||||
|
||||
|
||||
|
@ -76,7 +77,7 @@ float fog_backscatter(in float avisibility);
|
|||
float rayleigh_in_func(in float dist, in float air_pollution, in float avisibility, in float eye_alt, in float vertex_alt);
|
||||
|
||||
vec3 searchlight();
|
||||
vec3 landing_light(in float offset);
|
||||
vec3 landing_light(in float offset, in float offsetv);
|
||||
vec3 rayleigh_out_shift(in vec3 color, in float outscatter);
|
||||
vec3 get_hazeColor(in float light_arg);
|
||||
|
||||
|
@ -305,15 +306,14 @@ if ((dist < 5000.0)&& (quality_level > 3) && (wetness>0.0))
|
|||
}
|
||||
if (use_landing_light == 1)
|
||||
{
|
||||
secondary_light += landing_light(landing_light1_offset);
|
||||
secondary_light += landing_light(landing_light1_offset, landing_light3_offset);
|
||||
}
|
||||
if (use_alt_landing_light == 1)
|
||||
{
|
||||
secondary_light += landing_light(landing_light2_offset);
|
||||
secondary_light += landing_light(landing_light2_offset, landing_light3_offset);
|
||||
}
|
||||
color.rgb +=secondary_light * light_distance_fading(dist);
|
||||
|
||||
|
||||
fragColor = color * texel + specular;
|
||||
|
||||
|
||||
|
@ -322,7 +322,6 @@ float lightArg = (terminator-yprime_alt)/100000.0;
|
|||
vec3 hazeColor = get_hazeColor(lightArg);
|
||||
|
||||
|
||||
|
||||
// Rayleigh color shifts
|
||||
|
||||
if ((quality_level > 5) && (tquality_level > 5))
|
||||
|
@ -338,14 +337,13 @@ vec3 hazeColor = get_hazeColor(lightArg);
|
|||
fragColor.rgb = mix(fragColor.rgb, rayleighColor,rayleighStrength);
|
||||
}
|
||||
|
||||
|
||||
// here comes the terrain haze model
|
||||
|
||||
|
||||
float delta_z = hazeLayerAltitude - eye_alt;
|
||||
float mvisibility = min(visibility,avisibility);
|
||||
float mvisibility = min(visibility, avisibility);
|
||||
|
||||
if (dist > 0.04 * mvisibility)
|
||||
|
||||
{
|
||||
|
||||
alt = eye_alt;
|
||||
|
@ -438,17 +436,11 @@ else
|
|||
eqColorFactor = 1.0 - 0.1 * delta_zv/avisibility - (1.0 - effective_scattering);
|
||||
}
|
||||
|
||||
|
||||
|
||||
transmission = fog_func(transmission_arg, alt);
|
||||
|
||||
// there's always residual intensity, we should never be driven to zero
|
||||
if (eqColorFactor < 0.2) eqColorFactor = 0.2;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// now dim the light for haze
|
||||
eShade = 1.0 - 0.9 * smoothstep(-terminator_width+ terminator, terminator_width + terminator, yprime_alt);
|
||||
|
||||
|
@ -490,6 +482,7 @@ if (intensity > 0.0) // this needs to be a condition, because otherwise hazeColo
|
|||
hazeColor = mix(shadow * hazeColor, hazeColor, 0.3 + 0.7* smoothstep(250000.0, 400000.0, terminator));
|
||||
}
|
||||
|
||||
|
||||
// don't let the light fade out too rapidly
|
||||
lightArg = (terminator + 200000.0)/100000.0;
|
||||
float minLightIntensity = min(0.2,0.16 * lightArg + 0.5);
|
||||
|
@ -498,13 +491,11 @@ vec3 minLight = minLightIntensity * vec3 (0.2, 0.3, 0.4);
|
|||
hazeColor.rgb *= eqColorFactor * eShade;
|
||||
hazeColor.rgb = max(hazeColor.rgb, minLight.rgb);
|
||||
|
||||
fragColor.rgb = mix( hazeColor +secondary_light * fog_backscatter(mvisibility) , fragColor.rgb,transmission);
|
||||
|
||||
fragColor.rgb = mix(hazeColor +secondary_light * fog_backscatter(mvisibility) , fragColor.rgb,transmission);
|
||||
|
||||
}
|
||||
|
||||
gl_FragColor = fragColor;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ uniform float cloud_self_shading;
|
|||
uniform float air_pollution;
|
||||
uniform float landing_light1_offset;
|
||||
uniform float landing_light2_offset;
|
||||
uniform float landing_light3_offset;
|
||||
|
||||
uniform int quality_level;
|
||||
uniform int tquality_level;
|
||||
|
@ -51,7 +52,7 @@ float fog_backscatter(in float avisibility);
|
|||
vec3 rayleigh_out_shift(in vec3 color, in float outscatter);
|
||||
vec3 get_hazeColor(in float light_arg);
|
||||
vec3 searchlight();
|
||||
vec3 landing_light(in float offset);
|
||||
vec3 landing_light(in float offset, in float offsetv);
|
||||
|
||||
|
||||
float luminance(vec3 color)
|
||||
|
@ -129,11 +130,11 @@ void main()
|
|||
}
|
||||
if (use_landing_light == 1)
|
||||
{
|
||||
secondary_light += landing_light(landing_light1_offset);
|
||||
secondary_light += landing_light(landing_light1_offset, landing_light3_offset);
|
||||
}
|
||||
if (use_alt_landing_light == 1)
|
||||
{
|
||||
secondary_light += landing_light(landing_light2_offset);
|
||||
secondary_light += landing_light(landing_light2_offset, landing_light3_offset);
|
||||
}
|
||||
if (dist > 2.0) // we don't want to light the cockpit...
|
||||
{color.rgb +=secondary_light * light_distance_fading(dist);}
|
||||
|
|
|
@ -75,6 +75,7 @@ uniform float osg_SimulationTime;
|
|||
|
||||
uniform float landing_light1_offset;
|
||||
uniform float landing_light2_offset;
|
||||
uniform float landing_light3_offset;
|
||||
|
||||
// constants needed by the light and fog computations ###################################################
|
||||
|
||||
|
@ -101,7 +102,7 @@ float fog_backscatter(in float avisibility);
|
|||
vec3 rayleigh_out_shift(in vec3 color, in float outscatter);
|
||||
vec3 get_hazeColor(in float lightArg);
|
||||
vec3 searchlight();
|
||||
vec3 landing_light(in float offset);
|
||||
vec3 landing_light(in float offset, in float offsetv);
|
||||
|
||||
|
||||
|
||||
|
@ -287,11 +288,11 @@ void main (void)
|
|||
}
|
||||
if (use_landing_light == 1)
|
||||
{
|
||||
secondary_light += landing_light(landing_light1_offset);
|
||||
secondary_light += landing_light(landing_light1_offset, landing_light3_offset);
|
||||
}
|
||||
if (use_alt_landing_light == 1)
|
||||
{
|
||||
secondary_light += landing_light(landing_light2_offset);
|
||||
secondary_light += landing_light(landing_light2_offset, landing_light3_offset);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@ uniform float dust_resistance;
|
|||
uniform float slopeline_strength;
|
||||
uniform float landing_light1_offset;
|
||||
uniform float landing_light2_offset;
|
||||
uniform float landing_light3_offset;
|
||||
uniform float osg_SimulationTime;
|
||||
|
||||
uniform vec3 base_color;
|
||||
|
@ -79,7 +80,7 @@ float fog_backscatter(in float avisibility);
|
|||
vec3 rayleigh_out_shift(in vec3 color, in float outscatter);
|
||||
vec3 get_hazeColor(in float light_arg);
|
||||
vec3 searchlight();
|
||||
vec3 landing_light(in float offset);
|
||||
vec3 landing_light(in float offset, in float offsetv);
|
||||
|
||||
float light_func (in float x, in float a, in float b, in float c, in float d, in float e)
|
||||
{
|
||||
|
@ -466,11 +467,11 @@ if ((dist < 5000.0) && (combined_wetness>0.0))
|
|||
}
|
||||
if (use_landing_light == 1)
|
||||
{
|
||||
secondary_light += landing_light(landing_light1_offset);
|
||||
secondary_light += landing_light(landing_light1_offset, landing_light3_offset);
|
||||
}
|
||||
if (use_alt_landing_light == 1)
|
||||
{
|
||||
secondary_light += landing_light(landing_light2_offset);
|
||||
secondary_light += landing_light(landing_light2_offset, landing_light3_offset);
|
||||
}
|
||||
color.rgb +=secondary_light * light_distance_fading(dist);
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@ uniform float cloud_self_shading;
|
|||
uniform float uvstretch;
|
||||
uniform float landing_light1_offset;
|
||||
uniform float landing_light2_offset;
|
||||
uniform float landing_light3_offset;
|
||||
uniform float air_pollution;
|
||||
uniform float osg_SimulationTime;
|
||||
|
||||
|
@ -64,7 +65,7 @@ float fog_backscatter(in float avisibility);
|
|||
float rayleigh_in_func(in float dist, in float air_pollution, in float avisibility, in float eye_alt, in float vertex_alt);
|
||||
|
||||
vec3 searchlight();
|
||||
vec3 landing_light(in float offset);
|
||||
vec3 landing_light(in float offset, in float offsetv);
|
||||
vec3 rayleigh_out_shift(in vec3 color, in float outscatter);
|
||||
vec3 get_hazeColor(in float light_arg);
|
||||
|
||||
|
@ -272,11 +273,11 @@ if ((dist < 5000.0)&& (quality_level > 3) && (wetness>0.0))
|
|||
}
|
||||
if (use_landing_light == 1)
|
||||
{
|
||||
secondary_light += landing_light(landing_light1_offset);
|
||||
secondary_light += landing_light(landing_light1_offset, landing_light3_offset);
|
||||
}
|
||||
if (use_alt_landing_light == 1)
|
||||
{
|
||||
secondary_light += landing_light(landing_light2_offset);
|
||||
secondary_light += landing_light(landing_light2_offset, landing_light3_offset);
|
||||
}
|
||||
color.rgb +=secondary_light * light_distance_fading(dist);
|
||||
|
||||
|
@ -285,7 +286,7 @@ if ((dist < 5000.0)&& (quality_level > 3) && (wetness>0.0))
|
|||
|
||||
float lightArg = (terminator-yprime_alt)/100000.0;
|
||||
|
||||
vec3 hazeColor = get_hazeColor(lightArg);
|
||||
vec3 hazeColor = get_hazeColor(lightArg);
|
||||
|
||||
|
||||
// Rayleigh color shifts
|
||||
|
@ -304,10 +305,8 @@ float lightArg = (terminator-yprime_alt)/100000.0;
|
|||
}
|
||||
|
||||
|
||||
|
||||
// here comes the terrain haze model
|
||||
|
||||
|
||||
float delta_z = hazeLayerAltitude - eye_alt;
|
||||
float mvisibility = min(visibility, avisibility);
|
||||
|
||||
|
@ -412,8 +411,6 @@ transmission = fog_func(transmission_arg, alt);
|
|||
if (eqColorFactor < 0.2) eqColorFactor = 0.2;
|
||||
|
||||
|
||||
|
||||
|
||||
// Mie-like factor
|
||||
|
||||
if (lightArg < 10.0)
|
||||
|
@ -463,13 +460,8 @@ hazeColor.rgb = max(hazeColor.rgb, minLight.rgb);
|
|||
|
||||
fragColor.rgb = mix(hazeColor +secondary_light * fog_backscatter(mvisibility), fragColor.rgb,transmission);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
gl_FragColor = fragColor;
|
||||
|
||||
}
|
||||
|
|
|
@ -54,8 +54,7 @@ if (angularDist < lightRadius)
|
|||
else return vec3 (0.0,0.0,0.0);
|
||||
}
|
||||
|
||||
|
||||
vec3 landing_light(in float offset)
|
||||
vec3 landing_light(in float offset, in float offsetv)
|
||||
{
|
||||
|
||||
float fov_h = field_of_view;
|
||||
|
@ -69,7 +68,7 @@ else
|
|||
{yaw_offset = view_heading_offset;}
|
||||
|
||||
float x_offset = (float(display_xsize) / fov_h * (yaw_offset + offset));
|
||||
float y_offset = -(float(display_ysize) / fov_v * view_pitch_offset);
|
||||
float y_offset = -(float(display_ysize) / fov_v * (view_pitch_offset + offsetv));
|
||||
|
||||
vec2 center = vec2 (float(display_xsize) * 0.5 + x_offset, float(display_ysize) * 0.4 + y_offset);
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ uniform float cloud_self_shading;
|
|||
uniform float horizon_roughness;
|
||||
uniform float landing_light1_offset;
|
||||
uniform float landing_light2_offset;
|
||||
uniform float landing_light3_offset;
|
||||
|
||||
uniform int use_searchlight;
|
||||
uniform int use_landing_light;
|
||||
|
@ -38,7 +39,7 @@ float Noise2D(in vec2 coord, in float wavelength);
|
|||
float fog_backscatter(in float avisibility);
|
||||
|
||||
vec3 searchlight();
|
||||
vec3 landing_light(in float offset);
|
||||
vec3 landing_light(in float offset, in float offsetv);
|
||||
|
||||
float light_func (in float x, in float a, in float b, in float c, in float d, in float e)
|
||||
{
|
||||
|
@ -242,11 +243,11 @@ color = mix(color, terrainHazeColor ,smoothstep(hazeBlendAngle + ctterrain, 0.0+
|
|||
}
|
||||
if (use_landing_light == 1)
|
||||
{
|
||||
secondary_light += landing_light(landing_light1_offset);
|
||||
secondary_light += landing_light(landing_light1_offset, landing_light3_offset);
|
||||
}
|
||||
if (use_alt_landing_light == 1)
|
||||
{
|
||||
secondary_light += landing_light(landing_light2_offset);
|
||||
secondary_light += landing_light(landing_light2_offset, landing_light3_offset);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ uniform float cloud_self_shading;
|
|||
uniform float air_pollution;
|
||||
uniform float landing_light1_offset;
|
||||
uniform float landing_light2_offset;
|
||||
uniform float landing_light3_offset;
|
||||
|
||||
uniform int quality_level;
|
||||
uniform int tquality_level;
|
||||
|
@ -51,7 +52,7 @@ float fog_backscatter(in float avisibility);
|
|||
vec3 rayleigh_out_shift(in vec3 color, in float outscatter);
|
||||
vec3 get_hazeColor(in float light_arg);
|
||||
vec3 searchlight();
|
||||
vec3 landing_light(in float offset);
|
||||
vec3 landing_light(in float offset, in float offsetv);
|
||||
|
||||
|
||||
float luminance(vec3 color)
|
||||
|
@ -140,11 +141,11 @@ void main()
|
|||
}
|
||||
if (use_landing_light == 1)
|
||||
{
|
||||
secondary_light += landing_light(landing_light1_offset);
|
||||
secondary_light += landing_light(landing_light1_offset, landing_light3_offset);
|
||||
}
|
||||
if (use_alt_landing_light == 1)
|
||||
{
|
||||
secondary_light += landing_light(landing_light2_offset);
|
||||
secondary_light += landing_light(landing_light2_offset, landing_light3_offset);
|
||||
}
|
||||
if (dist > 2.0) // we don't want to light the cockpit...
|
||||
{color.rgb +=secondary_light * light_distance_fading(dist);}
|
||||
|
|
|
@ -77,6 +77,7 @@ uniform float osg_SimulationTime;
|
|||
|
||||
uniform float landing_light1_offset;
|
||||
uniform float landing_light2_offset;
|
||||
uniform float landing_light3_offset;
|
||||
|
||||
// constants needed by the light and fog computations ###################################################
|
||||
|
||||
|
@ -103,7 +104,7 @@ float fog_backscatter(in float avisibility);
|
|||
vec3 rayleigh_out_shift(in vec3 color, in float outscatter);
|
||||
vec3 get_hazeColor(in float lightArg);
|
||||
vec3 searchlight();
|
||||
vec3 landing_light(in float offset);
|
||||
vec3 landing_light(in float offset, in float offsetv);
|
||||
|
||||
|
||||
|
||||
|
@ -314,11 +315,11 @@ void main (void)
|
|||
}
|
||||
if (use_landing_light == 1)
|
||||
{
|
||||
secondary_light += landing_light(landing_light1_offset);
|
||||
secondary_light += landing_light(landing_light1_offset, landing_light3_offset);
|
||||
}
|
||||
if (use_alt_landing_light == 1)
|
||||
{
|
||||
secondary_light += landing_light(landing_light2_offset);
|
||||
secondary_light += landing_light(landing_light2_offset, landing_light3_offset);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -51,6 +51,7 @@ uniform float WindE;
|
|||
uniform float WindN;
|
||||
uniform float landing_light1_offset;
|
||||
uniform float landing_light2_offset;
|
||||
uniform float landing_light3_offset;
|
||||
uniform float osg_SimulationTime;
|
||||
|
||||
uniform int wind_effects;
|
||||
|
@ -83,7 +84,7 @@ float fog_backscatter(in float avisibility);
|
|||
vec3 rayleigh_out_shift(in vec3 color, in float outscatter);
|
||||
vec3 get_hazeColor(in float light_arg);
|
||||
vec3 searchlight();
|
||||
vec3 landing_light(in float offset);
|
||||
vec3 landing_light(in float offset, in float offsetv);
|
||||
|
||||
|
||||
|
||||
|
@ -463,11 +464,11 @@ if ((dist < 5000.0) && (combined_wetness>0.0))
|
|||
}
|
||||
if (use_landing_light == 1)
|
||||
{
|
||||
secondary_light += landing_light(landing_light1_offset);
|
||||
secondary_light += landing_light(landing_light1_offset, landing_light3_offset);
|
||||
}
|
||||
if (use_alt_landing_light == 1)
|
||||
{
|
||||
secondary_light += landing_light(landing_light2_offset);
|
||||
secondary_light += landing_light(landing_light2_offset, landing_light3_offset);
|
||||
}
|
||||
color.rgb +=secondary_light * light_distance_fading(dist);
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ uniform float dust_cover_factor;
|
|||
uniform float air_pollution;
|
||||
uniform float landing_light1_offset;
|
||||
uniform float landing_light2_offset;
|
||||
uniform float landing_light3_offset;
|
||||
uniform float cseason;
|
||||
|
||||
uniform int use_searchlight;
|
||||
|
@ -49,7 +50,7 @@ float fog_backscatter(in float avisibility);
|
|||
float rayleigh_in_func(in float dist, in float air_pollution, in float avisibility, in float eye_alt, in float vertex_alt);
|
||||
|
||||
vec3 searchlight();
|
||||
vec3 landing_light(in float offset);
|
||||
vec3 landing_light(in float offset, in float offsetv);
|
||||
vec3 get_hazeColor(in float light_arg);
|
||||
|
||||
float luminance(vec3 color)
|
||||
|
@ -197,11 +198,11 @@ void main()
|
|||
}
|
||||
if (use_landing_light == 1)
|
||||
{
|
||||
secondary_light += landing_light(landing_light1_offset);
|
||||
secondary_light += landing_light(landing_light1_offset, landing_light3_offset);
|
||||
}
|
||||
if (use_alt_landing_light == 1)
|
||||
{
|
||||
secondary_light += landing_light(landing_light2_offset);
|
||||
secondary_light += landing_light(landing_light2_offset, landing_light3_offset);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ uniform float dust_cover_factor;
|
|||
uniform float air_pollution;
|
||||
uniform float landing_light1_offset;
|
||||
uniform float landing_light2_offset;
|
||||
uniform float landing_light3_offset;
|
||||
uniform float cseason;
|
||||
|
||||
uniform int use_searchlight;
|
||||
|
@ -48,7 +49,7 @@ float fog_backscatter(in float avisibility);
|
|||
float rayleigh_in_func(in float dist, in float air_pollution, in float avisibility, in float eye_alt, in float vertex_alt);
|
||||
|
||||
vec3 searchlight();
|
||||
vec3 landing_light(in float offset);
|
||||
vec3 landing_light(in float offset, in float offsetv);
|
||||
vec3 get_hazeColor(in float light_arg);
|
||||
|
||||
|
||||
|
@ -168,11 +169,11 @@ void main()
|
|||
}
|
||||
if (use_landing_light == 1)
|
||||
{
|
||||
secondary_light += landing_light(landing_light1_offset);
|
||||
secondary_light += landing_light(landing_light1_offset, landing_light3_offset);
|
||||
}
|
||||
if (use_alt_landing_light == 1)
|
||||
{
|
||||
secondary_light += landing_light(landing_light2_offset);
|
||||
secondary_light += landing_light(landing_light2_offset, landing_light3_offset);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ uniform float cloud_self_shading;
|
|||
uniform float air_pollution;
|
||||
uniform float landing_light1_offset;
|
||||
uniform float landing_light2_offset;
|
||||
|
||||
uniform float landing_light3_offset;
|
||||
|
||||
uniform vec3 night_color;
|
||||
|
||||
|
@ -83,8 +83,7 @@ float fog_backscatter(in float avisibility);
|
|||
vec3 rayleigh_out_shift(in vec3 color, in float outscatter);
|
||||
vec3 get_hazeColor(in float light_arg);
|
||||
vec3 searchlight();
|
||||
vec3 landing_light(in float offset);
|
||||
|
||||
vec3 landing_light(in float offset, in float offsetv);
|
||||
|
||||
|
||||
void QDM(inout vec3 p, inout vec3 v)
|
||||
|
@ -308,11 +307,11 @@ if (gquality_level > 2)
|
|||
}
|
||||
if (use_landing_light == 1)
|
||||
{
|
||||
secondary_light += landing_light(landing_light1_offset);
|
||||
secondary_light += landing_light(landing_light1_offset, landing_light3_offset);
|
||||
}
|
||||
if (use_alt_landing_light == 1)
|
||||
{
|
||||
secondary_light += landing_light(landing_light2_offset);
|
||||
secondary_light += landing_light(landing_light2_offset, landing_light3_offset);
|
||||
}
|
||||
ambient_light = clamp(ambient_light,0.0,1.0);
|
||||
ambient_light.rgb +=secondary_light * light_distance_fading(dist);
|
||||
|
|
|
@ -61,6 +61,7 @@ uniform float sea_b;
|
|||
uniform float air_pollution;
|
||||
uniform float landing_light1_offset;
|
||||
uniform float landing_light2_offset;
|
||||
uniform float landing_light3_offset;
|
||||
|
||||
uniform int quality_level;
|
||||
uniform int tquality_level;
|
||||
|
@ -90,7 +91,7 @@ float fog_backscatter(in float avisibility);
|
|||
vec3 rayleigh_out_shift(in vec3 color, in float outscatter);
|
||||
vec3 get_hazeColor(in float light_arg);
|
||||
vec3 searchlight();
|
||||
vec3 landing_light(in float offset);
|
||||
vec3 landing_light(in float offset, in float offsetv);
|
||||
|
||||
//////////////////////
|
||||
|
||||
|
@ -470,11 +471,11 @@ void main(void)
|
|||
}
|
||||
if (use_landing_light == 1)
|
||||
{
|
||||
secondary_light += landing_light(landing_light1_offset);
|
||||
secondary_light += landing_light(landing_light1_offset, landing_light3_offset);
|
||||
}
|
||||
if (use_alt_landing_light == 1)
|
||||
{
|
||||
secondary_light += landing_light(landing_light2_offset);
|
||||
secondary_light += landing_light(landing_light2_offset, landing_light3_offset);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -289,6 +289,7 @@ Started September 2000 by David Megginson, david@megginson.com
|
|||
<use-alt-landing-light type="bool">false</use-alt-landing-light>
|
||||
<landing-light1-offset-deg type="float">0.0</landing-light1-offset-deg>
|
||||
<landing-light2-offset-deg type="float">0.0</landing-light2-offset-deg>
|
||||
<landing-light3-offset-deg type="float">0.0</landing-light3-offset-deg>
|
||||
<use-flashlight type="int">0</use-flashlight>
|
||||
</als-secondary-lights>
|
||||
</rendering>
|
||||
|
|
Loading…
Reference in a new issue