From 4af61aba47d4a91b09b414aa1ed60f7a336dc877 Mon Sep 17 00:00:00 2001 From: Emilian Huminiuc Date: Thu, 15 Mar 2012 21:06:45 +0200 Subject: [PATCH 1/3] Shaders/include_fog.frag: better fix for the common fog function Signed-off-by: Emilian Huminiuc --- Shaders/include_fog.frag | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Shaders/include_fog.frag b/Shaders/include_fog.frag index 69dc17257..3837f8358 100644 --- a/Shaders/include_fog.frag +++ b/Shaders/include_fog.frag @@ -6,7 +6,7 @@ vec3 fog_Func(vec3 color, int type) //if (type == 0){ const float LOG2 = 1.442695; //float fogCoord =length(PointPos); - float fogCoord = gl_FragCoord.z / gl_FragCoord.w; + float fogCoord = gl_ProjectionMatrix[3].z/(gl_FragCoord.z * -2.0 + 1.0 - gl_ProjectionMatrix[2].z); float fogFactor = exp2(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord * LOG2); if(gl_Fog.density == 1.0) From f03eedab487589cb8b729c1d0247152d8accdbbe Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Thu, 15 Mar 2012 20:23:45 +0100 Subject: [PATCH 2/3] #708: reset engine list on FDM reset Need to clear the engine list before appending a new set of engines. Engine list was growing on every FDM reset, causing weird control effects after (multiple) sim resets. --- Nasal/controls.nas | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Nasal/controls.nas b/Nasal/controls.nas index 07a612bf3..4c1f07cf5 100644 --- a/Nasal/controls.nas +++ b/Nasal/controls.nas @@ -462,6 +462,9 @@ _setlistener("/sim/signals/fdm-initialized", func { var sel = props.globals.getNode("/sim/input/selected", 1); var engs = props.globals.getNode("/controls/engines").getChildren("engine"); + # need to reset engine list on every FDM reset + engines = []; + # process all engines foreach(var e; engs) { var index = e.getIndex(); var s = sel.getChild("engine", index, 1); From f177be3126199ce4cf7b46403115547c31219715 Mon Sep 17 00:00:00 2001 From: Mathias Froehlich Date: Thu, 15 Mar 2012 21:30:27 +0100 Subject: [PATCH 3/3] scenery: use-custom-scenery-data is obsolete. --- preferences.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/preferences.xml b/preferences.xml index eb2d2febe..fff8e27ac 100644 --- a/preferences.xml +++ b/preferences.xml @@ -33,7 +33,6 @@ Started September 2000 by David Megginson, david@megginson.com - true