From 8769740bfc0bb7ec8aae25462b9646209614704a Mon Sep 17 00:00:00 2001 From: Durk Talsma Date: Mon, 30 Aug 2010 21:08:35 +0200 Subject: [PATCH 1/4] Added a new property related to a new AI feature that collects and saves AI traffic statistcs across sessions, in order to allow more efficient initialization. --- preferences.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/preferences.xml b/preferences.xml index c3f8c3327..8cd338604 100644 --- a/preferences.xml +++ b/preferences.xml @@ -596,6 +596,7 @@ Started September 2000 by David Megginson, david@megginson.com true + true false 1.0 From b92252c0a399c9e5591d904ef3d10241967497c6 Mon Sep 17 00:00:00 2001 From: "gral@who.net" Date: Tue, 31 Aug 2010 10:29:51 +0200 Subject: [PATCH 2/4] New checkbox transition shaders to separate rock/transition shader work from crop shaders --- Effects/forest.eff | 2 +- Effects/glacier.eff | 2 +- Effects/herbtundra.eff | 2 +- gui/dialogs/rendering.xml | 9 +++++++++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Effects/forest.eff b/Effects/forest.eff index e189b587a..438d30dfa 100644 --- a/Effects/forest.eff +++ b/Effects/forest.eff @@ -49,7 +49,7 @@ - /sim/rendering/crop-shader + /sim/rendering/transition-shader /sim/rendering/shader-effects diff --git a/Effects/glacier.eff b/Effects/glacier.eff index da9a06146..c5fb1f2db 100644 --- a/Effects/glacier.eff +++ b/Effects/glacier.eff @@ -49,7 +49,7 @@ - /sim/rendering/crop-shader + /sim/rendering/transition-shader /sim/rendering/shader-effects diff --git a/Effects/herbtundra.eff b/Effects/herbtundra.eff index 5f97c2112..6b819d16e 100644 --- a/Effects/herbtundra.eff +++ b/Effects/herbtundra.eff @@ -49,7 +49,7 @@ - /sim/rendering/crop-shader + /sim/rendering/transition-shader /sim/rendering/shader-effects diff --git a/gui/dialogs/rendering.xml b/gui/dialogs/rendering.xml index 114f1f0ca..29e42dbc8 100644 --- a/gui/dialogs/rendering.xml +++ b/gui/dialogs/rendering.xml @@ -270,6 +270,15 @@ dialog-apply + + + left + + /sim/rendering/transition-shader + + dialog-apply + + left From 24ea4dcd0a48365b5cb7453f07d8d3fa2b0fa471 Mon Sep 17 00:00:00 2001 From: "gral@who.net" Date: Tue, 31 Aug 2010 14:30:18 +0200 Subject: [PATCH 3/4] Change in effect cropgrass, it inherits from crop now --- Effects/cropgrass.eff | 90 +------------------------------------------ 1 file changed, 1 insertion(+), 89 deletions(-) diff --git a/Effects/cropgrass.eff b/Effects/cropgrass.eff index 72d1b554c..ee78881ce 100644 --- a/Effects/cropgrass.eff +++ b/Effects/cropgrass.eff @@ -1,7 +1,7 @@ Effects/cropgrass - Effects/terrain-default + Effects/crop Textures/Terrain/cropgrass.png @@ -18,92 +18,4 @@ /sim/rendering/snow-level-m - - - - /sim/rendering/crop-shader - /sim/rendering/shader-effects - - - 2.0 - - - - GL_ARB_shader_objects - GL_ARB_shading_language_100 - GL_ARB_vertex_shader - GL_ARB_fragment_shader - - - - - - true - - - material/ambient - material/diffuse - material/specular - ambient-and-diffuse - - transparent - transparent - smooth - back - - render-bin/bin-number - render-bin/bin-name - - - 0 - noise - - - 1 - texture[2]/image - texture[2]/filter - texture[2]/wrap-s - texture[2]/wrap-t - - texture[2]/internal-format - - - - 2 - 1d - texture[3]/image - texture[3]/filter - texture[3]/wrap-s - - texture[3]/internal-format - - - - Shaders/crop.vert - Shaders/crop.frag - - - NoiseTex - sampler-3d - 0 - - - SampleTex - sampler-2d - 1 - - - ColorsTex - sampler-1d - 2 - - - snowlevel - float - snow-level - - - From f08cd1f12d2de6f47ccbaf71982246a8984d3916 Mon Sep 17 00:00:00 2001 From: "gral@who.net" Date: Wed, 1 Sep 2010 14:58:55 +0200 Subject: [PATCH 4/4] Forest pixel shader edit, reduce bias mix (was: bright forest) --- Shaders/forest.frag | 11 ++++++----- Shaders/forest.vert | 4 ++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Shaders/forest.frag b/Shaders/forest.frag index 4641a8000..b0b08697f 100644 --- a/Shaders/forest.frag +++ b/Shaders/forest.frag @@ -7,6 +7,7 @@ varying vec3 VBinormal; varying vec3 VNormal; varying vec3 Normal; varying float bump; +varying float fogCoord; uniform sampler3D NoiseTex; uniform sampler2D SampleTex; @@ -98,13 +99,11 @@ void main (void) float vegetationlevel = (rawpos.z)+nvL[2]*3000.0; - float fogFactor; - float fogCoord = ecPosition.z; const float LOG2 = 1.442695; - fogFactor = exp2(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord * LOG2); + float fogFactor = exp(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord); float biasFactor = exp2(-0.00000002 * fogCoord * fogCoord * LOG2); - float n=0.06; + float n = 0.06; n += nvL[0]*0.4; n += nvL[1]*0.6; n += nvL[2]*2.0; @@ -114,7 +113,9 @@ void main (void) n += noisevec[2]*0.8; n += noisevec[3]*2.1; - n = mix(0.6, n, biasFactor); + + //very low n/biasFactor mix, to keep forest color + n = mix(0.05, n, biasFactor); vec4 c1; c1 = basecolor * vec4(smoothstep(-1.3, 0.5, n), smoothstep(-1.3, 0.5, n), smoothstep(-2.0, 0.9, n), 0.0); diff --git a/Shaders/forest.vert b/Shaders/forest.vert index de27c5ac3..8cf6cbb7e 100644 --- a/Shaders/forest.vert +++ b/Shaders/forest.vert @@ -6,6 +6,7 @@ varying vec3 VBinormal; varying vec3 Normal; varying vec4 constantColor; varying float bump; +varying float fogCoord; attribute vec3 tangent; attribute vec3 binormal; @@ -25,4 +26,7 @@ void main(void) + gl_FrontColor * (gl_LightModel.ambient + gl_LightSource[0].ambient); gl_Position = ftransform(); gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; + + fogCoord = abs(ecPosition.z / ecPosition.w); + }