From 31c231273232c11094ac452978ed0e11febdb68a Mon Sep 17 00:00:00 2001 From: Thorsten Renk Date: Mon, 28 Mar 2016 13:25:47 +0300 Subject: [PATCH] Prepare rock and base terrain effect for ALS filtering --- Effects/rock.eff | 33 +++++++++++++++++++++++++++ Effects/terrain-default.eff | 43 +++++++++++++++++++++++++++++++++++ Shaders/rock-ALS.frag | 3 +++ Shaders/terrain-ALS-base.frag | 2 ++ 4 files changed, 81 insertions(+) diff --git a/Effects/rock.eff b/Effects/rock.eff index 94984178a..1cfbb5ec4 100644 --- a/Effects/rock.eff +++ b/Effects/rock.eff @@ -93,6 +93,7 @@ Shaders/noise.frag Shaders/hazes.frag Shaders/secondary_lights.frag + Shaders/filters-ALS.frag intrinsic_wetness @@ -294,6 +295,38 @@ float landing_light3_offset + + + gamma + float + gamma + + + brightness + float + brightness + + + use_night_vision + bool + use_night_vision + + + use_IR_vision + bool + use_IR_vision + + + use_filtering + bool + use_filtering + + + delta_T + float + delta_T + + cloudpos1_x float diff --git a/Effects/terrain-default.eff b/Effects/terrain-default.eff index 0c45b20d1..64fe4d57e 100644 --- a/Effects/terrain-default.eff +++ b/Effects/terrain-default.eff @@ -1198,6 +1198,8 @@ Shaders/generic-ALS-base.vert Shaders/terrain-ALS-base.frag Shaders/hazes.frag + Shaders/noise.frag + Shaders/filters-ALS.frag visibility @@ -1259,6 +1261,47 @@ float air_pollution + + + gamma + float + gamma + + + brightness + float + brightness + + + use_night_vision + bool + use_night_vision + + + use_IR_vision + bool + use_IR_vision + + + use_filtering + bool + use_filtering + + + delta_T + float + delta_T + + + display_xsize + int + display_xsize + + + display_ysize + int + display_ysize + texture sampler-2d diff --git a/Shaders/rock-ALS.frag b/Shaders/rock-ALS.frag index a23dd1f59..a94fcfc3a 100644 --- a/Shaders/rock-ALS.frag +++ b/Shaders/rock-ALS.frag @@ -81,6 +81,7 @@ 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, in float offsetv); +vec3 filter_combined (in vec3 color) ; float light_func (in float x, in float a, in float b, in float c, in float d, in float e) { @@ -665,6 +666,8 @@ fragColor.rgb = mix(hazeColor + secondary_light * fog_backscatter(mvisibility), } +fragColor.rgb = filter_combined(fragColor.rgb); + gl_FragColor = fragColor; diff --git a/Shaders/terrain-ALS-base.frag b/Shaders/terrain-ALS-base.frag index 8b3522fc6..6154e4700 100644 --- a/Shaders/terrain-ALS-base.frag +++ b/Shaders/terrain-ALS-base.frag @@ -32,6 +32,7 @@ float eShade; float fog_func (in float targ, in float alt); vec3 get_hazeColor(in float light_arg); +vec3 filter_combined (in vec3 color) ; float luminance(vec3 color) { @@ -236,6 +237,7 @@ hazeColor.rgb = max(hazeColor.rgb, minLight.rgb); fragColor.rgb = mix(hazeColor, fragColor.rgb,transmission); } +fragColor.rgb = filter_combined(fragColor.rgb); gl_FragColor = fragColor;