diff --git a/Effects/forest.eff b/Effects/forest.eff index 2ab35deb6..78bc67924 100644 --- a/Effects/forest.eff +++ b/Effects/forest.eff @@ -34,6 +34,13 @@ 0.04 15.0 /sim/rendering/quality-level + + + 0.12 + 0.86 + 0.0 + + 6 @@ -173,6 +180,26 @@ float quality-level + + red + float + season-red + + + green + float + season-green + + + blue + float + season-blue + + + alpha + float + 0.0 + diff --git a/Effects/glacier.eff b/Effects/glacier.eff index 641c37be0..c6e58025a 100644 --- a/Effects/glacier.eff +++ b/Effects/glacier.eff @@ -34,6 +34,13 @@ 0.01 15.0 /sim/rendering/quality-level + + + 0.12 + 0.86 + 0.0 + + 6 @@ -173,6 +180,26 @@ float quality-level + + red + float + season-red + + + green + float + season-green + + + blue + float + season-blue + + + alpha + float + 0.0 + diff --git a/Effects/herbtundra.eff b/Effects/herbtundra.eff index 0d30ff2fd..ece1a4817 100644 --- a/Effects/herbtundra.eff +++ b/Effects/herbtundra.eff @@ -33,6 +33,13 @@ /sim/rendering/snow-level-m 0.01 15.0 + + + 0.12 + 0.86 + 0.0 + + /sim/rendering/quality-level @@ -173,6 +180,26 @@ float quality-level + + red + float + season-red + + + green + float + season-green + + + blue + float + season-blue + + + alpha + float + 0.0 + diff --git a/Shaders/forest.frag b/Shaders/forest.frag index e54016026..0dc6c620e 100644 --- a/Shaders/forest.frag +++ b/Shaders/forest.frag @@ -15,6 +15,8 @@ uniform sampler2D SampleTex2; uniform sampler2D NormalTex; uniform float depth_factor; +uniform float red, green, blue, alpha; + uniform float quality_level; // From /sim/rendering/quality-level uniform float snowlevel; // From /sim/rendering/snow-level-m @@ -102,7 +104,7 @@ void main (void) fogFactor = exp2(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord * LOG2); float biasFactor = exp2(-0.00000002 * fogCoord * fogCoord * LOG2); - float n=0.02; + float n=0.06; n += nvL[0]*0.4; n += nvL[1]*0.6; n += nvL[2]*2.0; @@ -126,9 +128,10 @@ void main (void) //draw floor where !steep, and another blurb for smoothing transitions vec4 c3, c4, c5, c3a, c4a, c5a; - c3 = mix(vec4(n-0.88, n-0.14, -n, 0.0), c1, smoothstep(0.990, 0.970, abs(normalize(Normal).z)+nvL[2]*1.3)); - c4 = mix(vec4(n-0.88, n-0.74, -n, 0.0), c1, smoothstep(0.990, 0.890, abs(normalize(Normal).z)+nvL[2]*0.9)); - c4a = mix(vec4(n-0.76, n-0.66, -n, 0.3), c1, smoothstep(0.990, 0.970, abs(normalize(Normal).z)+nvL[2]*1.32)); + float subred = 1.0 - red; float subgreen = 1.0 - green; float subblue = 1.0 - blue; + c3 = mix(vec4(n-subred, n-subgreen, -n, alpha), c1, smoothstep(0.990, 0.970, abs(normalize(Normal).z)+nvL[2]*1.3)); + c4 = mix(vec4(n-subred, n-subgreen-0.6, -n, alpha), c1, smoothstep(0.990, 0.890, abs(normalize(Normal).z)+nvL[2]*0.9)); + c4a = mix(vec4(n-subred+0.12, n-subgreen-0.52, -n, 0.0), c1, smoothstep(0.990, 0.970, abs(normalize(Normal).z)+nvL[2]*1.32)); c5 = mix(c3, c4, 1.0); c5a = mix(c3, c4a, 1.0); @@ -173,10 +176,10 @@ void main (void) diffuse = gl_Color.rgb * max(0.8, dot(N, l)) * max(0.9, dot(VNormal, gl_LightSource[0].position.xyz)); } - //should come as varying! - vec4 constantColor = vec4(1.0, 1.0, 1.0, 0.0); - vec4 ambient_light = gl_LightSource[0].diffuse * constantColor * vec4(diffuse, 1.0); + //vec4 constantColor = vec4(1.0, 1.0, 1.0, 0.0); + + vec4 ambient_light = gl_LightSource[0].diffuse * vec4(diffuse, 0.0); c1 *= ambient_light; vec4 finalColor = c1;