diff --git a/Effects/tree-european-deciduous.eff b/Effects/tree-european-deciduous.eff
new file mode 100644
index 000000000..02b03fa06
--- /dev/null
+++ b/Effects/tree-european-deciduous.eff
@@ -0,0 +1,8 @@
+
+
+ Effects/tree-european-deciduous
+ Effects/tree
+
+ 8
+
+
diff --git a/Effects/tree-european-mixed.eff b/Effects/tree-european-mixed.eff
new file mode 100644
index 000000000..da967fd86
--- /dev/null
+++ b/Effects/tree-european-mixed.eff
@@ -0,0 +1,8 @@
+
+
+ Effects/tree-european-mixed
+ Effects/tree
+
+ 4
+
+
diff --git a/Effects/tree.eff b/Effects/tree.eff
index 8b5226d06..c6fb62716 100644
--- a/Effects/tree.eff
+++ b/Effects/tree.eff
@@ -17,6 +17,7 @@
+ 0
@@ -29,6 +30,7 @@
+
@@ -202,6 +204,11 @@
float
+
+ cseason
+ float
+
+
WindE
float
@@ -472,6 +479,11 @@
int
+
+ num_deciduous_trees
+ int
+
+
texture
sampler-2d
@@ -618,6 +630,11 @@
float
+
+ cseason
+ float
+
+
WindE
float
@@ -888,6 +905,11 @@
int
+
+ num_deciduous_trees
+ int
+
+
texture
sampler-2d
diff --git a/Materials/regions/europe.xml b/Materials/regions/europe.xml
index 254c6a91a..05e5fa037 100644
--- a/Materials/regions/europe.xml
+++ b/Materials/regions/europe.xml
@@ -60,6 +60,7 @@
Effects/cropgrass
+ Effects/tree-european-mixed
CropGrassCover
CropGrass
Terrain/cropgrass-hires-autumn.png
@@ -97,6 +98,7 @@
BuiltUpCover
Urban
+ Effects/tree-european-deciduous
Terrain/18th_century_city.png
Terrain/18th_century_city.mask.png
1000
@@ -245,4 +247,45 @@
12.0
+
+ Effects/forest
+ Effects/tree-european-deciduous
+ DeciduousBroadCover
+ DeciduousForest
+ Bog
+ Heath
+ Terrain/deciduous-hires-autumn.png
+ 2000
+ 2000
+ 10000000.0
+ 4000.0
+ Trees/deciduous-alt.png
+ 8
+
+ 25.0
+ 15.0
+ 1
+ 0.85
+
+
+
+ Effects/forest
+ Effects/tree-european-mixed
+ MixedForestCover
+ MixedForest
+ RainForest
+ Terrain/mixedforest-hires-autumn.png
+ 2000
+ 2000
+ 5000000.0
+ 4000.0
+ Trees/mixed-alt.png
+ 8
+
+ 25.0
+ 15.0
+ 1
+ 0.95
+
+
diff --git a/Materials/regions/global-summer.xml b/Materials/regions/global-summer.xml
index c329f0097..ba17e97d8 100644
--- a/Materials/regions/global-summer.xml
+++ b/Materials/regions/global-summer.xml
@@ -522,6 +522,15 @@
0.1
0.1
1e30
+
diff --git a/Shaders/tree-ALS.frag b/Shaders/tree-ALS.frag
index e3988f332..9f48306dd 100644
--- a/Shaders/tree-ALS.frag
+++ b/Shaders/tree-ALS.frag
@@ -11,6 +11,7 @@ uniform sampler2D texture;
varying float yprime_alt;
+varying float autumn_flag;
uniform float visibility;
uniform float avisibility;
@@ -26,6 +27,7 @@ uniform float dust_cover_factor;
uniform float air_pollution;
uniform float landing_light1_offset;
uniform float landing_light2_offset;
+uniform float cseason;
uniform int use_searchlight;
uniform int use_landing_light;
@@ -135,10 +137,22 @@ void main()
if (quality_level > 3)
{
+
+ // seasonal color changes
+
+ if ((cseason < 1.5)&& (autumn_flag > 0.0))
+ {
+ texel.r = min(1.0, (1.0 + 5.0 *cseason * autumn_flag ) * texel.r);
+ //texel.g = texel.g + 0.05 * (autumn_flag-0.5) * cseason;
+ texel.b = max(0.0, (1.0 - 8.0 * cseason) * texel.b);
+ }
+
// mix dust
vec4 dust_color = vec4 (0.76, 0.71, 0.56, texel.a);
texel = mix(texel, dust_color, clamp(0.6 * dust_cover_factor ,0.0, 1.0) );
+
+
}
@@ -346,6 +360,8 @@ fragColor.rgb = mix( hazeColor + secondary_light * fog_backscatter(mvisibility)
}
+//if (autumn_flag > 0.0) {fragColor = vec4 (0.0,0.0,0.0,1.0);}
+
gl_FragColor = fragColor;
}
diff --git a/Shaders/tree-ALS.vert b/Shaders/tree-ALS.vert
index 3ef742141..65c7e4136 100644
--- a/Shaders/tree-ALS.vert
+++ b/Shaders/tree-ALS.vert
@@ -22,10 +22,12 @@
varying vec3 relPos;
varying float yprime_alt;
+varying float autumn_flag;
uniform int colorMode;
uniform int wind_effects;
uniform int forest_effects;
+uniform int num_deciduous_trees;
uniform float hazeLayerAltitude;
uniform float terminator;
uniform float terrain_alt;
@@ -66,7 +68,6 @@ return e / pow((1.0 + a * exp(-b * (x-c)) ),(1.0/d));
void main()
{
- //vec4 light_diffuse;
vec4 light_ambient;
vec3 shadedFogColor = vec3(0.55, 0.67, 0.88);
@@ -81,6 +82,12 @@ void main()
float numVarieties = gl_Normal.z;
float texFract = floor(fract(gl_MultiTexCoord0.x) * numVarieties) / numVarieties;
+
+// determine whether the tree changes color in autumn
+ if (texFract < (float) num_deciduous_trees/numVarieties) {autumn_flag = 0.5 + fract(gl_Color.x);}
+ else {autumn_flag = 0.0;}
+
+
texFract += floor(gl_MultiTexCoord0.x) / numVarieties;
// Determine the rotation for the tree. The Fog Coordinate provides rotation information