diff --git a/Aircraft/Generic/flightrecorder/components/kx165.xml b/Aircraft/Generic/flightrecorder/components/kx165.xml new file mode 100644 index 000000000..e47a4a7c7 --- /dev/null +++ b/Aircraft/Generic/flightrecorder/components/kx165.xml @@ -0,0 +1,65 @@ + + + + + + + + + bool + /instrumentation/comm[%i]/serviceable + + + bool + /instrumentation/nav[%i]/serviceable + + + bool + /instrumentation/nav[%i]/power-btn + + + bool + /instrumentation/comm[%i]/frq-swap-btn + + + float + /instrumentation/comm[%i]/frequencies/selected-mhz + + + float + /instrumentation/comm[%i]/frequencies/standby-mhz + + + float + /instrumentation/comm[%i]/volume + + + bool + /instrumentation/comm[%i]/test-btn + + + bool + /instrumentation/nav[%i]/frq-swap-btn + + + float + /instrumentation/nav[%i]/frequencies/selected-mhz + + + float + /instrumentation/nav[%i]/frequencies/standby-mhz + + + float + /instrumentation/nav[%i]/volume + + + bool + /instrumentation/nav[%i]/audio-btn + + + float + /instrumentation/comm[%i]/dimming-norm + + + diff --git a/Effects/bowwave.eff b/Effects/bowwave.eff index f97084b11..ecd7db865 100644 --- a/Effects/bowwave.eff +++ b/Effects/bowwave.eff @@ -109,7 +109,7 @@ /environment/terminator-relative-position-m - /sim/rendering/scattering-shader + /sim/rendering/shaders/skydome @@ -117,10 +117,9 @@ /sim/rendering/shaders/water - 2.0 - /sim/rendering/shaders/quality-level + /sim/rendering/shaders/water @@ -492,7 +491,6 @@ /sim/rendering/shaders/water - /sim/rendering/shaders/quality-level 2.0 diff --git a/Effects/bumpspec.eff b/Effects/bumpspec.eff index a74aeb326..032f5e816 100644 --- a/Effects/bumpspec.eff +++ b/Effects/bumpspec.eff @@ -37,7 +37,7 @@ in Aircraft/A320/Models/Effects/a320_bumpspec.eff ( or whatever, private to the - /sim/rendering/shader-effects + /sim/rendering/shaders/model 2.0 diff --git a/Effects/flutter.eff b/Effects/flutter.eff index 8a4c6574c..138d8ba4e 100644 --- a/Effects/flutter.eff +++ b/Effects/flutter.eff @@ -41,7 +41,7 @@ /environment/terminator-relative-position-m - /sim/rendering/scattering-shader + /sim/rendering/shaders/skydome @@ -49,11 +49,7 @@ - - - 3.0 - /sim/rendering/shaders/quality-level - + /sim/rendering/shaders/generic 2.0 diff --git a/Effects/landmass.eff b/Effects/landmass.eff index 0e62aff13..4170f36fc 100644 --- a/Effects/landmass.eff +++ b/Effects/landmass.eff @@ -16,7 +16,7 @@ 0.01 15.0 - /sim/rendering/shaders/quality-level + /sim/rendering/shaders/landmass @@ -37,7 +37,7 @@ /environment/terminator-relative-position-m - /sim/rendering/scattering-shader + /sim/rendering/shaders/skydome @@ -50,8 +50,8 @@ /sim/rendering/shaders/landmass - 4.5 - /sim/rendering/shaders/quality-level + 4.0 + /sim/rendering/shaders/landmass diff --git a/Effects/lightmap.eff b/Effects/lightmap.eff index 43e510c91..1e2535394 100644 --- a/Effects/lightmap.eff +++ b/Effects/lightmap.eff @@ -9,13 +9,13 @@ 1 - /sim/rendering/shader-effects + /sim/rendering/shader/generic 1 - /sim/rendering/shader-effects + /sim/rendering/shaders/generic 2.0 diff --git a/Effects/model-combined.eff b/Effects/model-combined.eff index b32db1096..b32c33525 100644 --- a/Effects/model-combined.eff +++ b/Effects/model-combined.eff @@ -12,8 +12,9 @@ please see Docs/README.model-combined.eff for documentation white - 0 - 0 + 0 + 0 + 1.0 Aircraft/Generic/Effects/null_bumpspec.png linear-mipmap-linear @@ -22,16 +23,16 @@ please see Docs/README.model-combined.eff for documentation normalized - 0 - 0 - 1.0 - 1.0 1.0 1.0 - 1.0 - 1.0 1.0 1.0 - 1.0 - 1.0 1.0 1.0 - 1.0 - 1.0 1.0 1.0 + 0 + 0 + 1.0 + 1.0 1.0 1.0 + 1.0 + 1.0 1.0 1.0 + 1.0 + 1.0 1.0 1.0 + 1.0 + 1.0 1.0 1.0 Aircraft/Generic/Effects/greymap.png linear-mipmap-linear @@ -40,10 +41,10 @@ please see Docs/README.model-combined.eff for documentation normalized - 0 - 0.0 - 0 - 0 + 0 + 0.0 + 0 + 0 Aircraft/Generic/Effects/ReflectMaps/reflectmap.png linear-mipmap-linear @@ -69,7 +70,7 @@ please see Docs/README.model-combined.eff for documentation - 0.1 + 0.1 Aircraft/Generic/Effects/FresnelLookUp.png linear-mipmap-linear @@ -78,7 +79,7 @@ please see Docs/README.model-combined.eff for documentation normalized - 0.01 + 0.01 Aircraft/Generic/Effects/Rainbow.png linear-mipmap-linear @@ -86,12 +87,16 @@ please see Docs/README.model-combined.eff for documentation repeat normalized - 0.25 + 0.25 + + 0 + 0.0 0.0 0.0 + 0.0 - 0.05 + 0.05 - 2 + 2 opaque @@ -102,15 +107,15 @@ please see Docs/README.model-combined.eff for documentation smooth - + orientation/model/heading-deg - - + + orientation/model/pitch-deg - - + + orientation/model/roll-deg - + /environment/ground-visibility-m @@ -128,7 +133,7 @@ please see Docs/README.model-combined.eff for documentation /environment/terminator-relative-position-m - /sim/rendering/scattering-shader + /sim/rendering/shaders/skydome @@ -142,7 +147,6 @@ please see Docs/README.model-combined.eff for documentation /sim/rendering/shaders/model - /sim/rendering/shaders/quality-level 2.0 @@ -424,7 +428,7 @@ please see Docs/README.model-combined.eff for documentation nmap_enabled int - normalmap_enabled + normalmap-enabled @@ -433,7 +437,15 @@ please see Docs/README.model-combined.eff for documentation nmap_dds int - normalmap_dds + normalmap-dds + + + + + nmap_tile + int + + normalmap-tiling @@ -443,7 +455,7 @@ please see Docs/README.model-combined.eff for documentation lightmap_enabled int - lightmap_enabled + lightmap-enabled @@ -451,7 +463,7 @@ please see Docs/README.model-combined.eff for documentation lightmap_multi int - lightmap_multi + lightmap-multi @@ -459,7 +471,7 @@ please see Docs/README.model-combined.eff for documentation lightmap_r_factor float - lightmap_factor[0] + lightmap-factor[0] @@ -467,7 +479,7 @@ please see Docs/README.model-combined.eff for documentation lightmap_r_color float-vec3 - lightmap_color[0] + lightmap-color[0] @@ -475,7 +487,7 @@ please see Docs/README.model-combined.eff for documentation lightmap_g_factor float - lightmap_factor[1] + lightmap-factor[1] @@ -483,7 +495,7 @@ please see Docs/README.model-combined.eff for documentation lightmap_g_color float-vec3 - lightmap_color[1] + lightmap-color[1] @@ -491,7 +503,7 @@ please see Docs/README.model-combined.eff for documentation lightmap_b_factor float - lightmap_factor[2] + lightmap-factor[2] @@ -499,7 +511,7 @@ please see Docs/README.model-combined.eff for documentation lightmap_b_color float-vec3 - lightmap_color[2] + lightmap-color[2] @@ -507,15 +519,15 @@ please see Docs/README.model-combined.eff for documentation lightmap_a_factor float - lightmap_factor[3] + lightmap-factor[3] lightmap_a_color - float-vec3 + float-vec3 - lightmap_color[3] + lightmap-color[3] @@ -524,7 +536,7 @@ please see Docs/README.model-combined.eff for documentation refl_enabled int - reflection_enabled + reflection-enabled @@ -532,7 +544,7 @@ please see Docs/README.model-combined.eff for documentation refl_correction float - reflection_correction + reflection-correction @@ -541,7 +553,7 @@ please see Docs/README.model-combined.eff for documentation refl_map int - reflect_map_enabled + reflect-map-enabled @@ -549,7 +561,7 @@ please see Docs/README.model-combined.eff for documentation refl_dynamic int - reflection_dynamic + reflection-dynamic @@ -558,7 +570,7 @@ please see Docs/README.model-combined.eff for documentation refl_rainbow float - reflection_rainbow + reflection-rainbow @@ -567,7 +579,7 @@ please see Docs/README.model-combined.eff for documentation refl_fresnel float - reflection_fresnel + reflection-fresnel @@ -576,16 +588,40 @@ please see Docs/README.model-combined.eff for documentation refl_noise float - reflection_noise + reflection-noise + + + dirt_enabled + int + + dirt-enabled + + + + + dirt_color + float-vec3 + + dirt-color + + + + + dirt_factor + float + + dirt-factor + + amb_correction float - ambient_correction + ambient-correction @@ -593,7 +629,7 @@ please see Docs/README.model-combined.eff for documentation shader_qual int - shader_quality + shader-quality @@ -601,7 +637,7 @@ please see Docs/README.model-combined.eff for documentation hdg float - model_hdg + model-hdg @@ -609,7 +645,7 @@ please see Docs/README.model-combined.eff for documentation pitch float - model_pitch + model-pitch @@ -617,7 +653,7 @@ please see Docs/README.model-combined.eff for documentation roll float - model_roll + model-roll diff --git a/Effects/model-default.eff b/Effects/model-default.eff index cfde14342..33db40101 100644 --- a/Effects/model-default.eff +++ b/Effects/model-default.eff @@ -28,14 +28,14 @@ /environment/terminator-relative-position-m - /sim/rendering/scattering-shader + /sim/rendering/shaders/skydome - /sim/rendering/shader-effects + /sim/rendering/shaders/generic 2.0 diff --git a/Effects/rain-layer.eff b/Effects/rain-layer.eff index c524e4ebc..f0296c360 100644 --- a/Effects/rain-layer.eff +++ b/Effects/rain-layer.eff @@ -8,7 +8,7 @@ - /sim/rendering/shader-effects + /sim/rendering/clouds3d-enable 1.0 diff --git a/Effects/reflect-bump-spec.eff b/Effects/reflect-bump-spec.eff index e062b0f12..706a20730 100644 --- a/Effects/reflect-bump-spec.eff +++ b/Effects/reflect-bump-spec.eff @@ -123,7 +123,7 @@ EXAMPLES: You can find examples of both usages in the Hunter and Lightning model /environment/terminator-relative-position-m - /sim/rendering/scattering-shader + /sim/rendering/shaders/skydome @@ -135,7 +135,7 @@ EXAMPLES: You can find examples of both usages in the Hunter and Lightning model - /sim/rendering/shader-effects + /sim/rendering/shaders/model 2.0 diff --git a/Effects/reflect.eff b/Effects/reflect.eff index 7b0104774..819cc3ebe 100644 --- a/Effects/reflect.eff +++ b/Effects/reflect.eff @@ -114,7 +114,7 @@ - /sim/rendering/shader-effects + /sim/rendering/shaders/model 2.0 diff --git a/Effects/runway.eff b/Effects/runway.eff index 8d8ca491e..8433eb4ab 100644 --- a/Effects/runway.eff +++ b/Effects/runway.eff @@ -15,15 +15,15 @@ - - - Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_px.png - Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_nx.png - Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_py.png - Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_ny.png - Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_pz.png - Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_nz.png - + + + Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_px.png + Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_nx.png + Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_py.png + Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_ny.png + Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_pz.png + Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_nz.png + @@ -51,10 +51,9 @@ smooth 0.01 0.01 - 0.01 + 0.15 - 0.01 - 1 + -0.15 1 false back @@ -79,7 +78,7 @@ /environment/terminator-relative-position-m - /sim/rendering/scattering-shader + /sim/rendering/shaders/skydome @@ -90,7 +89,7 @@ - /sim/rendering/shader-effects + /sim/rendering/shaders/generic 2.0 @@ -227,7 +226,7 @@ cull-face - + Shaders/include_fog.vert Shaders/reflect-bump-spec.vert diff --git a/Effects/skydome.eff b/Effects/skydome.eff index fb19e2698..849af3f32 100644 --- a/Effects/skydome.eff +++ b/Effects/skydome.eff @@ -36,7 +36,6 @@ - /sim/rendering/shaders/quality-level /sim/rendering/shaders/skydome diff --git a/Effects/terrain-default.eff b/Effects/terrain-default.eff index 3a0f5e909..223c6e7b0 100644 --- a/Effects/terrain-default.eff +++ b/Effects/terrain-default.eff @@ -51,7 +51,7 @@ /environment/terminator-relative-position-m - /sim/rendering/scattering-shader + /sim/rendering/shaders/skydome @@ -94,7 +94,6 @@ parameters : /sim/rendering/shaders/transition - /sim/rendering/shaders/quality-level 2.0 diff --git a/Effects/tree.eff b/Effects/tree.eff index e06c5e908..4307175ea 100644 --- a/Effects/tree.eff +++ b/Effects/tree.eff @@ -33,14 +33,13 @@ /environment/terminator-relative-position-m - /sim/rendering/scattering-shader + /sim/rendering/shaders/skydome - /sim/rendering/random-vegetation 1.0 diff --git a/Effects/urban.eff b/Effects/urban.eff index ef355b43b..611178d41 100644 --- a/Effects/urban.eff +++ b/Effects/urban.eff @@ -29,7 +29,7 @@ /environment/terminator-relative-position-m - /sim/rendering/scattering-shader + /sim/rendering/shaders/skydome @@ -43,29 +43,26 @@ /sim/rendering/shaders/urban - /sim/rendering/shaders/quality-level 4.0 /sim/rendering/shaders/urban - - - - 2.0 - - - - GL_ARB_shader_objects - GL_ARB_shading_language_100 - GL_ARB_vertex_shader - GL_ARB_fragment_shader - - - - GL_ATI_shader_texture_lod - GL_ARB_shader_texture_lod - - + + + 2.0 + + + + GL_ARB_shader_objects + GL_ARB_shading_language_100 + GL_ARB_vertex_shader + GL_ARB_fragment_shader + + + + GL_ATI_shader_texture_lod + GL_ARB_shader_texture_lod + @@ -290,29 +287,23 @@ /sim/rendering/shaders/urban - 2.0 - /sim/rendering/shaders/quality-level + /sim/rendering/shaders/urban - - - - 2.0 - - - - GL_ARB_shader_objects - GL_ARB_shading_language_100 - GL_ARB_vertex_shader - GL_ARB_fragment_shader - - - - GL_ATI_shader_texture_lod - GL_ARB_shader_texture_lod - - + + + 2.0 + + + + GL_ARB_shader_objects + GL_ARB_shading_language_100 + GL_ARB_vertex_shader + GL_ARB_fragment_shader + + + diff --git a/Effects/water-inland.eff b/Effects/water-inland.eff index 999c90dca..57f266baa 100644 --- a/Effects/water-inland.eff +++ b/Effects/water-inland.eff @@ -66,18 +66,17 @@ /environment/terminator-relative-position-m - /sim/rendering/scattering-shader + /sim/rendering/shaders/skydome - /sim/rendering/water-shader - /sim/rendering/shader-effects + /sim/rendering/shaders/water 2.0 - /sim/rendering/quality-level + /sim/rendering/shaders/water @@ -310,8 +309,7 @@ - /sim/rendering/water-shader - /sim/rendering/shader-effects + /sim/rendering/shaders/water 2.0 diff --git a/Effects/water.eff b/Effects/water.eff index 64b0628f0..d58e282e9 100644 --- a/Effects/water.eff +++ b/Effects/water.eff @@ -125,7 +125,7 @@ /environment/terminator-relative-position-m - /sim/rendering/scattering-shader + /sim/rendering/shaders/skydome diff --git a/Input/Joysticks/Accelerometers/accelerometers.xml b/Input/Joysticks/Accelerometers/accelerometers.xml index 186449c2e..148f9405b 100644 --- a/Input/Joysticks/Accelerometers/accelerometers.xml +++ b/Input/Joysticks/Accelerometers/accelerometers.xml @@ -12,6 +12,7 @@ $Id$ + applesmc ST LIS3LV02DL Accelerometer ST LIS3L V02DL Accelerometer diff --git a/Input/Joysticks/ThrustMaster/Warthog/README b/Input/Joysticks/ThrustMaster/Warthog/README index 6e50bc028..2f97e8dd8 100644 --- a/Input/Joysticks/ThrustMaster/Warthog/README +++ b/Input/Joysticks/ThrustMaster/Warthog/README @@ -101,8 +101,10 @@ via raw HID support. $ mkdir -p ~/.fgfs/Nasal $ cp $FG_ROOT/Nasal/IOrules ~/.fgfs/Nasal - Now add these two lines there: + Now add these four lines there: + READ ALLOW /dev/input/hidraw/Thustmaster_Joystick_-_HOTAS_Warthog + READ ALLOW /dev/input/hidraw/Thrustmaster_Throttle_-_HOTAS_Warthog WRITE ALLOW /dev/input/hidraw/Thustmaster_Joystick_-_HOTAS_Warthog WRITE ALLOW /dev/input/hidraw/Thrustmaster_Throttle_-_HOTAS_Warthog diff --git a/Input/Joysticks/ThrustMaster/Warthog/Stick/stick_rotate.xml b/Input/Joysticks/ThrustMaster/Warthog/Stick/stick_rotate.xml index e467ae1e8..d1d98216e 100644 --- a/Input/Joysticks/ThrustMaster/Warthog/Stick/stick_rotate.xml +++ b/Input/Joysticks/ThrustMaster/Warthog/Stick/stick_rotate.xml @@ -9,10 +9,13 @@ diff --git a/Nasal/aircraft.nas b/Nasal/aircraft.nas index a8c2b08bc..cf9118652 100644 --- a/Nasal/aircraft.nas +++ b/Nasal/aircraft.nas @@ -1034,9 +1034,15 @@ var HUD = { init: func { me.vis1N = props.globals.getNode("/sim/hud/visibility[1]", 1); me.currcolN = props.globals.getNode("/sim/hud/current-color", 1); + me.currentPathN = props.globals.getNode("/sim/hud/current-path", 1); + me.hudN = props.globals.getNode("/sim/hud", 1); me.paletteN = props.globals.getNode("/sim/hud/palette", 1); me.brightnessN = props.globals.getNode("/sim/hud/color/brightness", 1); me.currentN = me.vis1N; + + # keep compatibility with earlier version of FG - hud/path[1] is + # the default Hud + me.currentPathN.setIntValue(1); }, cycle_color: func { # h-key if (!me.currentN.getBoolValue()) # if off, turn on @@ -1057,10 +1063,16 @@ var HUD = { me.brightnessN.setValue(br > 0.01 ? br : 1); }, normal_type: func { # i-key - + me.currentPathN.setIntValue(1); }, cycle_type: func { # I-key - + var i = me.currentPathN.getValue() + 1; + if (i < 1 or i > size(me.hudN.getChildren("path"))) { + # back to the start + me.currentPathN.setIntValue(1); + } else { + me.currentPathN.setIntValue(i); + } }, is_active: func { me.vis1N.getValue(); diff --git a/Shaders/runway-reflect-bump-spec.frag b/Shaders/runway-reflect-bump-spec.frag index 30b6a8db6..77263b807 100644 --- a/Shaders/runway-reflect-bump-spec.frag +++ b/Shaders/runway-reflect-bump-spec.frag @@ -1,6 +1,6 @@ // -*- mode: C; -*- // Licence: GPL v2 -// © Emilian Huminiuc and Vivian Meazza 2011 +// © Emilian Huminiuc and Vivian Meazza 2011 #version 120 @@ -8,7 +8,6 @@ varying vec3 rawpos; varying vec3 VNormal; varying vec3 VTangent; varying vec3 VBinormal; -varying vec3 Normal; varying vec3 vViewVec; varying vec3 reflVec; @@ -29,117 +28,112 @@ uniform float rainbowiness; uniform float fresneliness; uniform float noisiness; uniform float ambient_correction; -uniform float reflect_map; uniform float normalmap_dds; //uniform int fogType; -////fog "include" ///// -uniform int fogType; - -vec3 fog_Func(vec3 color, int type); +////fog "include" ///// +uniform int fogType; + +vec3 fog_Func(vec3 color, int type); ////////////////////// vec3 fog_Func(vec3 color, int type); void main (void) { - vec3 halfV; - float NdotL, NdotHV; + //vec3 halfV; + //float NdotL, NdotHV; + + vec4 texel = texture2D(BaseTex, gl_TexCoord[0].st); + vec4 nmap = texture2D(NormalTex, gl_TexCoord[0].st * 8.0); + vec4 map = texture2D(Map, gl_TexCoord[0].st * 8.0); + vec4 specNoise = texture3D(Noise, rawpos.xyz * 0.0045); + vec4 noisevec = texture3D(Noise, rawpos.xyz); vec3 lightDir = gl_LightSource[0].position.xyz; vec3 halfVector = gl_LightSource[0].halfVector.xyz; + vec3 N; + float pf; + // vec4 color = gl_Color; + //vec4 specular = vec4(0.0); - vec4 color = gl_Color; - vec4 specular = vec4(0.0); - vec4 ns = texture2D(NormalTex, gl_TexCoord[0].st * 16.0); - vec3 n = ns.rgb * 2.0 - 1.0; - n = normalize(n.x * VTangent + n.y * VBinormal + n.z * VNormal); + N = nmap.rgb * 2.0 - 1.0; + N = normalize(N.x * VTangent + N.y * VBinormal + N.z * VNormal); + if (normalmap_dds > 0) + N = -N; - //fix dds normal - if (normalmap_dds > 0.0) { - n = -n; - } - - NdotL = max(0.0, dot(n, lightDir)); // calculate the specular light - if (NdotL > 0.0) { - color += Diffuse * NdotL; - halfV = normalize(halfVector); - NdotHV = max(dot(n, halfV), 0.0); - if (gl_FrontMaterial.shininess > 0.0) - specular.rgb = (gl_FrontMaterial.specular.rgb * ns.a - * gl_LightSource[0].specular.rgb - * pow(NdotHV, gl_FrontMaterial.shininess + 128 * spec_adjust)); - } + float refl_correction = spec_adjust * 1.9 - 1.0; + float shininess = max (0.35, refl_correction); + float nDotVP = max(0.0, dot(N, normalize(gl_LightSource[0].position.xyz))); + float nDotHV = max(0.0, dot(N, normalize(gl_LightSource[0].halfVector.xyz))); + + if (nDotVP == 0.0) + pf = 0.0; + else + pf = pow(nDotHV, /*gl_FrontMaterial.*/shininess); + + vec4 Diffuse = gl_LightSource[0].diffuse * nDotVP; + vec4 Specular = /*gl_FrontMaterial.specular*/ vec4(vec3(0.5*shininess), 1.0)* gl_LightSource[0].specular * pf; + + vec4 color = gl_Color + Diffuse * gl_FrontMaterial.diffuse; + color += Specular * /*gl_FrontMaterial.specular*/ vec4(vec3(0.5*shininess), 1.0) * nmap.a; //color.a = alpha; - vec4 texel = texture2D(BaseTex, gl_TexCoord[0].st); + //vec4 texelcolor = color * texel + specular; color.a = texel.a * alpha; color = clamp(color, 0.0, 1.0); - // calculate the fog factor - //const float LOG2 = 1.442695; - //float fogFactor = exp2(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord * LOG2); - //fogFactor = clamp(fogFactor, 0.0, 1.0); - - //if(gl_Fog.density == 1.0) - // fogFactor=1.0; - - vec3 normal = normalize(VNormal); vec3 viewVec = normalize(vViewVec); // Map a rainbowish color - float v = dot(viewVec, normal); + float v = dot(viewVec, normalize(VNormal)); vec4 rainbow = texture2D(Rainbow, vec2(v, 0.0)); // Map a fresnel effect vec4 fresnel = texture2D(Fresnel, vec2(v, 0.0)); // map the refection of the environment - vec4 reflection = textureCube(Environment, reflVec); + vec4 reflection = textureCube(Environment, reflVec * dot(N,VNormal)); + - float refl_correction = spec_adjust * 1.7 - 1.0; // set the user shininess offset float transparency_offset = clamp(refl_correction, -1.0, 1.0); float reflFactor = 0.0; - vec4 map = texture2D(Map, gl_TexCoord[0].st * 8.0); - if(reflect_map > 0.0){ - // map the shininess of the object with user input - //float pam = (map.a * -2) + 1; //reverse map - reflFactor = map.a *(1.0- n.z) + transparency_offset; - } else { - // set the reflectivity proportional to shininess with user input - reflFactor = (gl_FrontMaterial.shininess / 128.0) + transparency_offset; - } + //vec4 specNoise1 = texture3D(Noise, rawpos.xyz*0.001); - reflFactor = clamp(reflFactor, 0.0, 0.75); + float MixFactor = specNoise.r * specNoise.g * specNoise.b * 350.0; + //MixFactor *= specNoise1.r; + MixFactor = 0.75 * smoothstep(0.0, 1.0, MixFactor); + + reflFactor = max(map.a * (texel.r + texel.g), 1.0 - MixFactor) * (1.0- N.z) + transparency_offset ; + //reflFactor = clamp(reflFactor, 0.0, 0.75); + reflFactor =0.75 * smoothstep(0.05, 1.0, reflFactor); // set ambient adjustment to remove bluiness with user input float ambient_offset = clamp(ambient_correction, -1.0, 1.0); vec4 ambient_Correction = vec4(gl_LightSource[0].ambient.rg, gl_LightSource[0].ambient.b * 0.6, 0.5) * ambient_offset ; ambient_Correction = clamp(ambient_Correction, -1.0, 1.0); - // map noise vector - vec4 noisevec = texture3D(Noise, rawpos.xyz); - // add fringing fresnel and rainbow effects and modulate by reflection vec4 reflcolor = mix(reflection, rainbow, rainbowiness * v); + reflcolor += Specular * nmap.a; vec4 reflfrescolor = mix(reflcolor, fresnel, fresneliness * v); vec4 noisecolor = mix(reflfrescolor, noisevec, noisiness); vec4 raincolor = vec4(noisecolor.rgb * reflFactor, 1.0); + raincolor += Specular * nmap.a; vec4 mixedcolor = mix(texel, raincolor, reflFactor); // the final reflection - vec4 reflColor = vec4(color.rgb * mixedcolor.rgb + specular.rgb + ambient_Correction.rgb, color.a); + vec4 fragColor = vec4(color.rgb * mixedcolor.rgb + ambient_Correction.rgb, color.a); + fragColor += Specular * nmap.a; - reflColor = clamp(reflColor, 0.0, 1.0); - vec4 fragColor = reflColor; fragColor.rgb = fog_Func(fragColor.rgb, fogType); gl_FragColor = fragColor; } \ No newline at end of file diff --git a/Shaders/ubershader.frag b/Shaders/ubershader.frag index 1884be159..26addfc47 100644 --- a/Shaders/ubershader.frag +++ b/Shaders/ubershader.frag @@ -25,11 +25,13 @@ uniform sampler3D ReflNoiseTex; uniform int nmap_enabled; uniform int nmap_dds; +uniform int nmap_tile; uniform int refl_enabled; uniform int refl_map; uniform int lightmap_enabled; uniform int lightmap_multi; uniform int shader_qual; +uniform int dirt_enabled; uniform float lightmap_r_factor; uniform float lightmap_g_factor; @@ -40,12 +42,15 @@ uniform float refl_fresnel; uniform float refl_rainbow; uniform float refl_noise; uniform float amb_correction; +uniform float dirt_factor; uniform vec3 lightmap_r_color; uniform vec3 lightmap_g_color; uniform vec3 lightmap_b_color; uniform vec3 lightmap_a_color; +uniform vec3 dirt_color; + ///fog include////////////////////// uniform int fogType; vec3 fog_Func(vec3 color, int type); @@ -54,10 +59,9 @@ vec3 fog_Func(vec3 color, int type); void main (void) { vec4 texel = texture2D(BaseTex, gl_TexCoord[0].st); - vec4 nmap = texture2D(NormalTex, gl_TexCoord[0].st); + vec4 nmap = texture2D(NormalTex, gl_TexCoord[0].st * nmap_tile); vec4 reflmap = texture2D(ReflMapTex, gl_TexCoord[0].st); vec4 noisevec = texture3D(ReflNoiseTex, rawpos.xyz); - vec4 reflection = textureCube(Environment, reflVec); vec4 lightmapTexel = texture2D(LightMapTex, gl_TexCoord[0].st); vec3 mixedcolor; @@ -74,6 +78,7 @@ void main (void) N = normalize(VNormal); } ///END bump + vec4 reflection = textureCube(Environment, reflVec * dot(N,VNormal)); vec3 viewVec = normalize(vViewVec); float v = dot(viewVec, normalize(VNormal));// Map a rainbowish color vec4 fresnel = texture2D(ReflFresnelTex, vec2(v, 0.0)); @@ -81,6 +86,11 @@ void main (void) float nDotVP = max(0.0, dot(N, normalize(gl_LightSource[0].position.xyz))); float nDotHV = max(0.0, dot(N, normalize(gl_LightSource[0].halfVector.xyz))); + //glare on the backside of tranparent objects + if ((gl_FrontMaterial.diffuse.a < 1.0 || texel.a < 1.0) && dot(N, normalize(gl_LightSource[0].position.xyz)) < 0.0) { + nDotVP = max(0.0, dot(-N, normalize(gl_LightSource[0].position.xyz))); + nDotHV = max(0.0, dot(-N, normalize(gl_LightSource[0].halfVector.xyz))); + } if (nDotVP == 0.0) pf = 0.0; @@ -93,9 +103,10 @@ void main (void) vec4 color = gl_Color + Diffuse * gl_FrontMaterial.diffuse; color += Specular * gl_FrontMaterial.specular * nmap.a; color = clamp( color, 0.0, 1.0 ); -////////////////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////////////// //BEGIN reflect -////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////// if (refl_enabled > 0 && shader_qual > 0){ float reflFactor; float transparency_offset = clamp(refl_correction, -1.0, 1.0);// set the user shininess offset @@ -124,9 +135,9 @@ void main (void) } else { mixedcolor = texel.rgb; } -/////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////// //END reflect -/////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////// // set ambient adjustment to remove bluiness with user input float ambient_offset = clamp(amb_correction, -1.0, 1.0); @@ -135,6 +146,20 @@ void main (void) color.a = texel.a * alpha; vec4 fragColor = vec4(color.rgb * mixedcolor + ambient_Correction.rgb, color.a); + +////////////////////////////////////////////////////////////////////// +//begin DIRT +////////////////////////////////////////////////////////////////////// + if (dirt_enabled > 0.0){ + vec3 dirtColor = dirt_color * noisevec.rgb; + float dirtFactor = reflmap.r * dirt_factor; + dirtFactor = smoothstep(0.0, 1.0, dirtFactor); + fragColor.rgb = mix(fragColor.rgb, dirtColor, dirtFactor); + } +////////////////////////////////////////////////////////////////////// +//END Dirt +////////////////////////////////////////////////////////////////////// + fragColor += Specular * nmap.a; ////////////////////////////////////////////////////////////////////// diff --git a/Sounds/avionics-400Hz.wav b/Sounds/avionics-400Hz.wav new file mode 100644 index 000000000..7c35742f8 Binary files /dev/null and b/Sounds/avionics-400Hz.wav differ diff --git a/Translations/strings-default.xml b/Translations/strings-default.xml index e689a2676..2d517abf4 100644 --- a/Translations/strings-default.xml +++ b/Translations/strings-default.xml @@ -309,5 +309,6 @@ Trace the reads for a property; Trace the writes for a property; Specify which logging level to use + Specify which logging class(es) to use diff --git a/gui/dialogs/rendering.xml b/gui/dialogs/rendering.xml index 461992151..c524c8edc 100644 --- a/gui/dialogs/rendering.xml +++ b/gui/dialogs/rendering.xml @@ -171,7 +171,7 @@ left - + random-objects /sim/rendering/random-objects @@ -341,7 +341,22 @@ true - + + + vbox + 4 + + 0 + + left + + + 0 + + left + + + hbox @@ -375,9 +390,6 @@ hbox