$ git remote add -t directional_moonlight_v1 u-edauvergne-simgear git://git.code.sf.net/u/edauvergne/simgear
$ git fetch u-edauvergne-simgear
$ git checkout directional_moonlight_v1
$ fgfs --airport=KSFO --aircraft=UFO --start-date-lat=2015:12:02:23:40:00 --altitude=100 --heading=133
$ fgfs --airport=KSFO --aircraft=UFO --start-date-lat=2015:12:11:02:29:00 --altitude=100 --heading=133
$ fgfs --airport=KSFO --aircraft=UFO --start-date-lat=2015:12:18:05:14:00 --altitude=100 --heading=133
$ fgfs --airport=KSFO --aircraft=UFO --start-date-lat=2015:12:25:03:11:00 --altitude=100 --heading=133
legoboyvdlp wrote in Thu Jan 07, 2016 1:32 pm:Afraid I don't see any difference...
Great job! Is there much performance impact?
bugman wrote in Thu Jan 07, 2016 2:48 pm:legoboyvdlp wrote in Thu Jan 07, 2016 1:32 pm:Afraid I don't see any difference...
The moonlight is much more noticeable when it's full screen and the room is not too bright (as moonlight should be). But take a careful look at the runway markings, the dirt around the runway, and the hangar on the left. See if you can see them in the 'new moon' test screenshot.
there is zero impact on the fps... It could only have an impact on CPU usage...
MIG29pilot wrote in Thu Jan 07, 2016 3:38 pm:How does it look looking up through haze at a full moon?
$ grep moon *
3dcloud-ALS.vert:uniform float moonlight;
3dcloud-ALS.vert: vec3 moonLightColor = vec3 (0.095, 0.095, 0.15) * moonlight * scattering;
3dcloud-ALS.vert: gl_FrontColor.rgb = gl_FrontColor.rgb + moonLightColor * earthShadeFactor;
3dcloud-ALS.vert: hazeColor.rgb = hazeColor.rgb + moonLightColor * earthShadeFactor;
cloud-impostor-ALS.vert:uniform float moonlight;
cloud-impostor-ALS.vert: vec3 moonLightColor = vec3 (0.095, 0.095, 0.15) * moonlight;
cloud-impostor-ALS.vert: gl_FrontColor.rgb = gl_FrontColor.rgb + moonLightColor * (1.0 - smoothstep(0.4, 0.5, earthShade));
cloud-impostor-ALS.vert: hazeColor.rgb = hazeColor.rgb + moonLightColor * (1.0 - smoothstep(0.4, 0.5, earthShade));
cloud-noctilucent-ALS.vert:uniform float moonlight;
cloud-noctilucent-ALS.vert: vec3 moonLightColor = vec3 (0.095, 0.095, 0.15) * moonlight;
cloud-noctilucent-ALS.vert: gl_FrontColor.rgb = gl_FrontColor.rgb + moonLightColor * (1.0 - smoothstep(0.4, 0.5, earthShade));
cloud-noctilucent-ALS.vert: hazeColor.rgb = hazeColor.rgb + moonLightColor * (1.0 - smoothstep(0.4, 0.5, earthShade));
cloud-static-ALS.vert:uniform float moonlight;
cloud-static-ALS.vert: vec3 moonLightColor = vec3 (0.095, 0.095, 0.15) * moonlight;
cloud-static-ALS.vert: gl_FrontColor.rgb = gl_FrontColor.rgb + moonLightColor * (1.0 - smoothstep(0.4, 0.5, earthShade));
cloud-static-ALS.vert: hazeColor.rgb = hazeColor.rgb + moonLightColor * (1.0 - smoothstep(0.4, 0.5, earthShade));
flutter-ALS.vert:uniform float moonlight;
flutter-ALS.vert: vec3 moonLightColor = vec3 (0.095, 0.095, 0.15) * moonlight;
flutter-ALS.vert: light_ambient.rgb = light_ambient.rgb + moonLightColor * (1.0 - smoothstep(0.4, 0.5, earthShade));
generic-ALS-base.vert:uniform float moonlight;
generic-ALS-base.vert: vec3 moonLightColor = vec3 (0.095, 0.095, 0.15) * moonlight;
generic-ALS-base.vert: light_ambient.rgb = light_ambient.rgb + moonLightColor * (1.0 - smoothstep(0.4, 0.5, earthShade));
glass-ALS.vert:uniform float moonlight;
glass-ALS.vert:vec3 moonLightColor = vec3 (0.095, 0.095, 0.15) * moonlight;
glass-ALS.vert: light_ambient.rgb = light_ambient.rgb + moonLightColor * (1.0 - smoothstep(0.4, 0.5, earthShade));
model-ALS-ultra.frag:uniform float moonlight;
model-ALS-ultra.frag: vec3 moonLightColor = vec3 (0.095, 0.095, 0.15) * moonlight;
model-ALS-ultra.frag: light_ambient.rgb = light_ambient.rgb + moonLightColor * (1.0 - smoothstep(0.4, 0.5, earthShade));
model-interior-ALS-detailed.vert:uniform float moonlight;
model-interior-ALS-detailed.vert: vec3 moonLightColor = vec3 (0.095, 0.095, 0.15) * moonlight;
model-interior-ALS-detailed.vert: light_ambient.rgb = light_ambient.rgb + moonLightColor * (1.0 - smoothstep(0.4, 0.5, earthShade));
shadow-ALS.vert:uniform float moonlight;
shadow-vol-ALS.vert:uniform float moonlight;
space-ALS-base.vert:uniform float moonlight;
space-ALS-base.vert: vec3 moonLightColor = vec3 (0.095, 0.095, 0.15) * moonlight;
space-ALS-base.vert: light_ambient.rgb = light_ambient.rgb + moonLightColor * (1.0 - smoothstep(0.4, 0.5, earthShade));
space-ALS-ultra.frag:uniform float moonlight;
space-ALS-ultra.frag: vec3 moonLightColor = vec3 (0.095, 0.095, 0.15) * moonlight;
space-ALS-ultra.frag: light_ambient.rgb = light_ambient.rgb + moonLightColor * (1.0 - smoothstep(0.4, 0.5, earthShade));
space-ALS-ultra.frag: light_ambient.rgb = light_ambient.rgb + moonLightColor * (1.0 - smoothstep(0.4, 0.5, earthShade));
terrain-ALS-detailed.vert:uniform float moonlight;
terrain-ALS-detailed.vert: vec3 moonLightColor = vec3 (0.095, 0.095, 0.15) * moonlight;
terrain-ALS-detailed.vert: light_ambient.rgb = light_ambient.rgb + moonLightColor * (1.0 - smoothstep(0.4, 0.5, earthShade));
terrain-ALS-ultra.vert:uniform float moonlight;
terrain-ALS-ultra.vert: vec3 moonLightColor = vec3 (0.095, 0.095, 0.15) * moonlight;
terrain-ALS-ultra.vert: light_ambient.rgb = light_ambient.rgb + moonLightColor * (1.0 - smoothstep(0.4, 0.5, earthShade));
urban-ALS.vert:uniform float moonlight;
urban-ALS.vert: vec3 moonLightColor = vec3 (0.095, 0.095, 0.15) * moonlight;
urban-ALS.vert: light_ambient.rgb = light_ambient.rgb + moonLightColor * (1.0 - smoothstep(0.4, 0.5, earthShade));
I do not want to encode a complex algorithm directly into the shaders when a once a second update is more than sufficient.
Thorsten wrote in Mon Jan 11, 2016 11:26 am:I do not want to encode a complex algorithm directly into the shaders when a once a second update is more than sufficient.
Feel free to learn it the hard way, but:
* the issue in ALS is to have it 'per pixel' more than to have it 'per frame' - which is why it can't be done on the CPU (you need to run light 4 million times for a typical screen).
* while you may think it's sufficient to update light every second, it is in fact not - you see such discontinuities much earlier than you'd naively expect.
Also (and that's a subtle one), ALS does light beyond Blinn-Phong (i.e. the decomposition in ambient, specular and diffuse). You will see that e.g. aircraft running high quality models effects still render glossy on their shaded surfaces, cf. here
which they never do in Blinn-Phong.
There is specularity and direction in indirect light in ALS in many subtle ways, so please don't start from the assumption that ambient/diffuse/specular is all you need.
I am however starting to get the impression that some parts/operations in common to many shaders that could be shifted out of this and into FGLight::update() and encoded directly into the GL light source settings.
Is ALS not in any way already bound by the GL light source, which is updated - position and settings - once a second?
All rendering pipelines should aim to follow the real life illumination models, so there will be many common illumination concepts.
Users browsing this forum: No registered users and 1 guest