1
0
Fork 0

More infrastructure for perception filtering of moonlight

This commit is contained in:
Thorsten Renk 2017-11-13 10:27:25 +02:00
parent 405e754583
commit e5f4b0a511
11 changed files with 25 additions and 2 deletions

View file

@ -70,6 +70,7 @@
</texture-unit>
<program>
<vertex-shader>Shaders/cloud-impostor-ALS.vert</vertex-shader>
<vertex-shader>Shaders/filters-ALS.vert</vertex-shader>
<fragment-shader>Shaders/cloud-static-ALS.frag</fragment-shader>
<fragment-shader>Shaders/noise.frag</fragment-shader>
<fragment-shader>Shaders/filters-ALS.frag</fragment-shader>

View file

@ -57,6 +57,7 @@
</texture-unit>
<program>
<vertex-shader>Shaders/cloud-noctilucent-ALS.vert</vertex-shader>
<vertex-shader>Shaders/filters-ALS.vert</vertex-shader>
<fragment-shader>Shaders/cloud-static-ALS.frag</fragment-shader>
</program>
<uniform>

View file

@ -67,6 +67,7 @@
</texture-unit>
<program>
<vertex-shader>Shaders/cloud-static-ALS.vert</vertex-shader>
<vertex-shader>Shaders/filters-ALS.vert</vertex-shader>
<fragment-shader>Shaders/cloud-static-ALS.frag</fragment-shader>
<fragment-shader>Shaders/noise.frag</fragment-shader>
<fragment-shader>Shaders/filters-ALS.frag</fragment-shader>

View file

@ -72,6 +72,7 @@
</texture-unit>
<program>
<vertex-shader>Shaders/3dcloud-ALS.vert</vertex-shader>
<vertex-shader>Shaders/filters-ALS.vert</vertex-shader>
<fragment-shader>Shaders/3dcloud-ALS.frag</fragment-shader>
<fragment-shader>Shaders/filters-ALS.frag</fragment-shader>
<fragment-shader>Shaders/noise.frag</fragment-shader>

View file

@ -30,6 +30,8 @@ float top_factor = usrAttr2.b;
const float EarthRadius = 5800000.0;
vec3 moonlight_perception (in vec3 light);
// light_func is a generalized logistic function fit to the light intensity as a function
// of scaled terminator position obtained from Flightgear core
@ -68,6 +70,8 @@ void main(void)
vec3 shadedFogColor = vec3(0.55, 0.67, 0.88);
vec3 moonLightColor = vec3 (0.095, 0.095, 0.15) * moonlight * scattering;
moonLightColor = moonlight_perception (moonLightColor);
gl_TexCoord[0] = gl_MultiTexCoord0;
vec4 ep = gl_ModelViewMatrixInverse * vec4(0.0,0.0,0.0,1.0);
vec4 l = gl_ModelViewMatrixInverse * vec4(0.0,0.0,1.0,1.0);

View file

@ -16,6 +16,8 @@ const float shade = 1.0;
const float cloud_height = 1000.0;
const float EarthRadius = 5800000.0;
vec3 moonlight_perception (in vec3 light);
// light_func is a generalized logistic function fit to the light intensity as a function
// of scaled terminator position obtained from Flightgear core
@ -36,6 +38,7 @@ void main(void)
vec3 shadedFogColor = vec3 (0.55, 0.67, 0.88);
vec3 moonLightColor = vec3 (0.095, 0.095, 0.15) * moonlight;
moonLightColor = moonlight_perception (moonLightColor);
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
//gl_TexCoord[0] = gl_MultiTexCoord0 + vec4(textureIndexX, textureIndexY, 0.0, 0.0);

View file

@ -13,6 +13,8 @@ const float shade = 1.0;
const float cloud_height = 1000.0;
const float EarthRadius = 5800000.0;
vec3 moonlight_perception (in vec3 light);
// light_func is a generalized logistic function fit to the light intensity as a function
// of scaled terminator position obtained from Flightgear core
@ -33,6 +35,7 @@ void main(void)
vec3 shadedFogColor = vec3 (0.55, 0.67, 0.88);
vec3 moonLightColor = vec3 (0.095, 0.095, 0.15) * moonlight;
moonLightColor = moonlight_perception (moonLightColor);
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
//gl_TexCoord[0] = gl_MultiTexCoord0 + vec4(textureIndexX, textureIndexY, 0.0, 0.0);

View file

@ -13,6 +13,8 @@ const float shade = 1.0;
const float cloud_height = 1000.0;
const float EarthRadius = 5800000.0;
vec3 moonlight_perception (in vec3 light);
// light_func is a generalized logistic function fit to the light intensity as a function
// of scaled terminator position obtained from Flightgear core
@ -33,6 +35,7 @@ void main(void)
vec3 shadedFogColor = vec3 (0.55, 0.67, 0.88);
vec3 moonLightColor = vec3 (0.095, 0.095, 0.15) * moonlight;
moonLightColor = moonlight_perception (moonLightColor);
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
//gl_TexCoord[0] = gl_MultiTexCoord0 + vec4(textureIndexX, textureIndexY, 0.0, 0.0);

View file

@ -25,6 +25,7 @@ uniform sampler2D structure_texture;
float Noise2D(in vec2 coord, in float wavelength);
vec3 filter_combined (in vec3 color) ;
vec3 moonlight_perception (in vec3 light);
float add_cosines (in float cos1, in float cos2, in float sign)
@ -140,6 +141,7 @@ void main()
color.rgb += lightning_color(gl_TexCoord[0].st) * (1.0 - texel.a) * lightning * darkness_fact;
vec3 moonLightColor = vec3 (0.095, 0.095, 0.15) * moonlight;
moonLightColor = moonlight_perception (moonLightColor);
color.rgb += moonLightColor;

View file

@ -22,6 +22,7 @@ uniform sampler2D normal_texture;
float Noise2D(in vec2 coord, in float wavelength);
vec3 filter_combined (in vec3 color) ;
vec3 moonlight_perception (in vec3 light);
void main()
@ -136,6 +137,7 @@ void main()
}
vec3 moonLightColor = vec3 (0.095, 0.095, 0.15) * moonlight;
moonLightColor = moonlight_perception (moonLightColor);
color.rgb += moonLightColor;
color.a = diffuse_term.a;

View file

@ -112,6 +112,7 @@ vec3 searchlight();
vec3 landing_light(in float offset, in float offsetv);
vec3 filter_combined (in vec3 color) ;
vec3 addLights(in vec3 color1, in vec3 color2);
vec3 moonlight_perception (in vec3 light);
float light_func (in float x, in float a, in float b, in float c, in float d, in float e)
@ -216,6 +217,7 @@ void main (void)
///some generic light scattering parameters
vec3 shadedFogColor = vec3(0.55, 0.67, 0.88);
vec3 moonLightColor = vec3 (0.095, 0.095, 0.15) * moonlight;
moonLightColor = moonlight_perception (moonLightColor);
float alt = eye_alt;
float effective_scattering = min(scattering, cloud_self_shading);