From 05e3eb80f4797ce5b8a1a6a0106a9907f51e4242 Mon Sep 17 00:00:00 2001 From: Emilian Huminiuc Date: Wed, 18 Jul 2012 20:45:45 +0300 Subject: [PATCH 1/4] Make the other sunlight shaders recognize water matId. Remove duplicate fogFunc line in runway.frag Signed-off-by: Emilian Huminiuc --- Shaders/runway.frag | 2 -- Shaders/sunlight-nofiltering.frag | 3 ++- Shaders/sunlight-noshadow.frag | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Shaders/runway.frag b/Shaders/runway.frag index fad9defd9..ca7b5ab00 100644 --- a/Shaders/runway.frag +++ b/Shaders/runway.frag @@ -38,8 +38,6 @@ uniform int fogType; vec3 fog_Func(vec3 color, int type); ////////////////////// -vec3 fog_Func(vec3 color, int type); - void main (void) { //vec3 halfV; diff --git a/Shaders/sunlight-nofiltering.frag b/Shaders/sunlight-nofiltering.frag index 38260c786..af9d0699e 100644 --- a/Shaders/sunlight-nofiltering.frag +++ b/Shaders/sunlight-nofiltering.frag @@ -6,6 +6,7 @@ uniform sampler2D spec_emis_tex; uniform sampler2DShadow shadow_tex; uniform vec4 fg_SunDiffuseColor; uniform vec4 fg_SunSpecularColor; +uniform vec4 fg_SunAmbientColor; uniform vec3 fg_SunDirection; uniform vec3 fg_Planes; uniform int fg_ShadowNumber; @@ -81,7 +82,7 @@ void main() { } float matID = texture2D( color_tex, coords ).a * 255.0; - if (matID == 255.0) + if (matID >= 254.0) Idiff += Ispec * spec_emis.x; gl_FragColor = vec4(mix(vec3(0.0), Idiff + Ispec, shadow) + Iemis, 1.0); diff --git a/Shaders/sunlight-noshadow.frag b/Shaders/sunlight-noshadow.frag index 8b670f5a4..2045b0f1c 100644 --- a/Shaders/sunlight-noshadow.frag +++ b/Shaders/sunlight-noshadow.frag @@ -35,7 +35,7 @@ void main() { } float matID = texture2D( color_tex, coords ).a * 255.0; - if (matID == 255.0) + if (matID >= 254.0) Idiff += Ispec * spec_emis.x; gl_FragColor = vec4(Idiff + Ispec + Iemis, 1.0); From e91620a456e855b3e0b5d22cccead357ab156f46 Mon Sep 17 00:00:00 2001 From: Stuart Buchanan Date: Thu, 19 Jul 2012 21:36:06 +0100 Subject: [PATCH 2/4] Remove building density slider. Values > 1.0 have massive memory impacts and can result in FG paging to disk continually and hanging some systems, with no obvious cause or fix (particularly with auto-save). For the moment we simply remove the slider, allowing power users to modify the density in preferences.xml. Once the memory consumption of buildings has been addressed we should be able to put the slide back in. --- gui/dialogs/rendering.xml | 65 ++++++++++----------------------------- 1 file changed, 17 insertions(+), 48 deletions(-) diff --git a/gui/dialogs/rendering.xml b/gui/dialogs/rendering.xml index f6218e2b2..904d6d200 100644 --- a/gui/dialogs/rendering.xml +++ b/gui/dialogs/rendering.xml @@ -247,6 +247,19 @@ 2 0 left + + random-buildings + /sim/rendering/random-buildings + + dialog-apply + random-buildings + + + + + 3 + 0 + left random-objects /sim/rendering/random-objects @@ -257,7 +270,7 @@ - 3 + 4 0 left @@ -269,7 +282,7 @@ - 3 + 4 1 @@ -277,7 +290,7 @@ - 3 + 4 2 vegetation-density 0 @@ -290,7 +303,7 @@ - 3 + 4 3 %.1f @@ -301,50 +314,6 @@ - - 4 - 0 - left - - random-buildings - /sim/rendering/random-buildings - - dialog-apply - random-buildings - - - - 4 - 1 - - - /sim/rendering/random-buildings - - - - 4 - 2 - building-density - 0 - 5.0 - 0.1 - /sim/rendering/building-density - - dialog-apply - building-density - - - - 4 - 3 - - %.1f - true - /sim/rendering/building-density - - /sim/rendering/random-buildings - -