From e9bac7dac438308adc27dcf44f391a8a8385f05b Mon Sep 17 00:00:00 2001 From: Thorsten Renk Date: Mon, 28 Mar 2016 18:19:05 +0300 Subject: [PATCH] Fix tiling issues in Tropical South America airport keep definitions --- Effects/airfield.eff | 36 ++++++++++++++++++++ Materials/regions/tropical_south_america.xml | 7 ++-- Shaders/airfield-ALS.frag | 11 +++++- 3 files changed, 51 insertions(+), 3 deletions(-) diff --git a/Effects/airfield.eff b/Effects/airfield.eff index d344d7612..0a348fdc8 100644 --- a/Effects/airfield.eff +++ b/Effects/airfield.eff @@ -19,9 +19,19 @@ repeat normalized + + Textures/Terrain/void.png + 2d + linear-mipmap-linear + repeat + repeat + normalized + 5.0 4.0 + 4.0 0 + 0 1 1.0 0.0 @@ -115,6 +125,17 @@ texture[14]/internal-format + + 2 + texture[15]/image + texture[15]/type + texture[15]/filter + texture[15]/wrap-s + texture[15]/wrap-t + + texture[15]/internal-format + + Shaders/terrain-ALS-ultra.vert Shaders/airfield-ALS.frag @@ -219,6 +240,11 @@ float overlay_layer_magnification + + grain_layer_magnification + float + grain_layer_magnification + cloud_self_shading float @@ -522,6 +548,11 @@ int use_overlay + + use_grain + int + use_grain + use_color_overlay int @@ -567,6 +598,11 @@ sampler-2d 1 + + grain_texture + sampler-2d + 2 + colorMode int diff --git a/Materials/regions/tropical_south_america.xml b/Materials/regions/tropical_south_america.xml index dd8fea1b6..1787e4e9f 100644 --- a/Materials/regions/tropical_south_america.xml +++ b/Materials/regions/tropical_south_america.xml @@ -51,15 +51,18 @@ Terrain/california-grass.png Terrain/california-grass.png - Terrain/airport_grass_overlay.png + Terrain/california-grass-hires.png + Terrain/airport_grass_overlay.png 0.4 1 - 0.5 + 1 + 0.0 0 1.0 4.0 + 4.0 128 128 diff --git a/Shaders/airfield-ALS.frag b/Shaders/airfield-ALS.frag index 1ce745b29..899a395a1 100644 --- a/Shaders/airfield-ALS.frag +++ b/Shaders/airfield-ALS.frag @@ -12,7 +12,7 @@ varying vec3 ecViewdir; uniform sampler2D texture; uniform sampler2D overlay_texture; - +uniform sampler2D grain_texture; varying float steepness; @@ -35,6 +35,7 @@ uniform float overlay_bias; uniform float overlay_alpha; uniform float base_layer_magnification; uniform float overlay_layer_magnification; +uniform float grain_layer_magnification; uniform float wetness; uniform float air_pollution; uniform float season; @@ -46,6 +47,7 @@ uniform int quality_level; uniform int tquality_level; uniform int cloud_shadow_flag; uniform int use_overlay; +uniform int use_grain; uniform int use_color_overlay; uniform int use_searchlight; uniform int use_landing_light; @@ -119,6 +121,7 @@ float ct = dot(vec3(0.0, 0.0, 1.0), relPos)/dist; {halfVector = normalize(normalize(lightDir) + normalize(ecViewdir));} vec4 texel; vec4 overlay_texel; + vec4 grain_texel; vec4 snow_texel; vec4 fragColor; vec4 specular = vec4(0.0); @@ -184,6 +187,12 @@ if (use_overlay == 1) } +if (use_grain == 1) + { + grain_texel = texture2D(grain_texture, gl_TexCoord[0].st * grain_layer_magnification); + texel.rgb = mix(texel.rgb, grain_texel.rgb, grain_texel.a); + } +