diff --git a/Aircraft/Generic/Effects/Gradients.png b/Aircraft/Generic/Effects/Gradients.png index 5406b14b2..93eab52fc 100644 Binary files a/Aircraft/Generic/Effects/Gradients.png and b/Aircraft/Generic/Effects/Gradients.png differ diff --git a/Effects/model-combined-deferred.eff b/Effects/model-combined-deferred.eff index c5370cd29..555fd3ac9 100644 --- a/Effects/model-combined-deferred.eff +++ b/Effects/model-combined-deferred.eff @@ -93,9 +93,9 @@ the objects that use it, and replaces it with the default shader. texture[0]/image - - texture[0]/type - + + texture[0]/type + texture[0]/filter @@ -120,9 +120,9 @@ the objects that use it, and replaces it with the default shader. texture[2]/image - - texture[2]/type - + + texture[2]/type + texture[2]/filter @@ -142,9 +142,9 @@ the objects that use it, and replaces it with the default shader. texture[3]/image - - texture[3]/type - + + texture[3]/type + texture[3]/filter @@ -164,9 +164,9 @@ the objects that use it, and replaces it with the default shader. texture[4]/image - - texture[4]/type - + + texture[4]/type + texture[4]/filter @@ -201,9 +201,9 @@ the objects that use it, and replaces it with the default shader. texture[6]/image - - texture[6]/type - + + texture[6]/type + texture[6]/filter @@ -218,7 +218,7 @@ the objects that use it, and replaces it with the default shader. - + --> @@ -285,7 +285,7 @@ the objects that use it, and replaces it with the default shader. 5 - - - - ReflGradientsTex - sampler-2d - 6 + --> + + + ReflGradientsTex + sampler-2d + 6 @@ -546,14 +546,6 @@ the objects that use it, and replaces it with the default shader. ambient-correction - - - shader_qual - int - - shader-quality - - hdg diff --git a/Effects/model-combined-transparent.eff b/Effects/model-combined-transparent.eff index fceb6a10f..3d1c68d27 100644 --- a/Effects/model-combined-transparent.eff +++ b/Effects/model-combined-transparent.eff @@ -79,13 +79,13 @@ and fallback to plain transparency when the model shader is disabled. DepthSortedBin - 0 + 0 texture[0]/active - - texture[0]/type - + + texture[0]/type + texture[0]/image @@ -198,9 +198,9 @@ and fallback to plain transparency when the model shader is disabled. texture[0]/image - - texture[0]/type - + + texture[0]/type + texture[0]/filter @@ -225,9 +225,9 @@ and fallback to plain transparency when the model shader is disabled. texture[2]/image - - texture[2]/type - + + texture[2]/type + texture[2]/filter @@ -247,9 +247,9 @@ and fallback to plain transparency when the model shader is disabled. texture[3]/image - - texture[3]/type - + + texture[3]/type + texture[3]/filter @@ -269,9 +269,9 @@ and fallback to plain transparency when the model shader is disabled. texture[4]/image - - texture[4]/type - + + texture[4]/type + texture[4]/filter @@ -308,9 +308,9 @@ and fallback to plain transparency when the model shader is disabled. texture[6]/image - - texture[6]/type - + + texture[6]/type + texture[6]/filter @@ -629,14 +629,6 @@ and fallback to plain transparency when the model shader is disabled. ambient-correction - - - shader_qual - int - - shader-quality - - hdg diff --git a/Effects/model-combined.eff b/Effects/model-combined.eff index ddc36214f..dd21306cc 100644 --- a/Effects/model-combined.eff +++ b/Effects/model-combined.eff @@ -8,16 +8,16 @@ please see Docs/README.model-combined.eff for documentation - + --> 0 0 1.0 Aircraft/Generic/Effects/null_bumpspec.png - 2d + 2d linear-mipmap-linear clamp clamp @@ -36,7 +36,7 @@ please see Docs/README.model-combined.eff for documentation 1.0 1.0 1.0 Aircraft/Generic/Effects/greymap.png - 2d + 2d linear-mipmap-linear clamp clamp @@ -49,7 +49,7 @@ please see Docs/README.model-combined.eff for documentation 0 Aircraft/Generic/Effects/ReflectMaps/reflectmap.png - 2d + 2d linear-mipmap-linear clamp clamp @@ -76,7 +76,7 @@ please see Docs/README.model-combined.eff for documentation 0.1 Aircraft/Generic/Effects/Gradients.png - 2d + 2d linear-mipmap-linear repeat repeat @@ -91,7 +91,7 @@ please see Docs/README.model-combined.eff for documentation 10 Textures/Terrain/void.png - 2d + 2d linear-mipmap-linear repeat repeat @@ -109,10 +109,6 @@ please see Docs/README.model-combined.eff for documentation 0.0 0.05 - - - /sim/rendering/shaders/model - opaque false @@ -245,9 +241,9 @@ please see Docs/README.model-combined.eff for documentation texture[0]/image - - texture[0]/type - + + texture[0]/type + texture[0]/filter @@ -272,9 +268,9 @@ please see Docs/README.model-combined.eff for documentation texture[2]/image - - texture[2]/type - + + texture[2]/type + texture[2]/filter @@ -294,9 +290,9 @@ please see Docs/README.model-combined.eff for documentation texture[3]/image - - texture[3]/type - + + texture[3]/type + texture[3]/filter @@ -316,9 +312,9 @@ please see Docs/README.model-combined.eff for documentation texture[4]/image - - texture[4]/type - + + texture[4]/type + texture[4]/filter @@ -355,9 +351,9 @@ please see Docs/README.model-combined.eff for documentation texture[6]/image - - texture[6]/type - + + texture[6]/type + texture[6]/filter @@ -377,9 +373,9 @@ please see Docs/README.model-combined.eff for documentation texture[7]/image - - texture[7]/type - + + texture[7]/type + texture[7]/filter @@ -712,14 +708,6 @@ please see Docs/README.model-combined.eff for documentation ambient-correction - - - shader_qual - int - - shader-quality - - hdg @@ -922,9 +910,9 @@ please see Docs/README.model-combined.eff for documentation texture[0]/image - - texture[0]/type - + + texture[0]/type + texture[0]/filter @@ -949,9 +937,9 @@ please see Docs/README.model-combined.eff for documentation texture[2]/image - - texture[2]/type - + + texture[2]/type + texture[2]/filter @@ -971,9 +959,9 @@ please see Docs/README.model-combined.eff for documentation texture[3]/image - - texture[3]/type - + + texture[3]/type + texture[3]/filter @@ -993,9 +981,9 @@ please see Docs/README.model-combined.eff for documentation texture[4]/image - - texture[4]/type - + + texture[4]/type + texture[4]/filter @@ -1032,9 +1020,9 @@ please see Docs/README.model-combined.eff for documentation texture[6]/image - - texture[6]/type - + + texture[6]/type + texture[6]/filter @@ -1353,14 +1341,6 @@ please see Docs/README.model-combined.eff for documentation ambient-correction - - - shader_qual - int - - shader-quality - - hdg diff --git a/Shaders/building-ubershader.vert b/Shaders/building-ubershader.vert index d0d8cee8c..7a6d8a06b 100644 --- a/Shaders/building-ubershader.vert +++ b/Shaders/building-ubershader.vert @@ -64,17 +64,20 @@ void main(void) normal.xy = vec2(dot(normal.xy, vec2(cr, sr)), dot(normal.xy, vec2(-sr, cr))); //normal = gl_NormalMatrix * normal; - VNormal = normalize(gl_NormalMatrix * normal); - if (nmap_enabled > 0 && shader_qual > 2){ - VTangent = normalize(gl_NormalMatrix * tangent); - VBinormal = normalize(gl_NormalMatrix * binormal); - } else { - VTangent = vec3(0.0); - VBinormal = vec3 (0.0); - } - vec3 n = normalize(normal); - vec3 t = cross(n, vec3(1.0,0.0,0.0)); - vec3 b = cross(n,t); + VNormal = normalize(gl_NormalMatrix * normal); + vec3 n = normalize(normal); + vec3 tempTangent = cross(n, vec3(1.0,0.0,0.0)); + vec3 tempBinormal = cross(n, tempTangent); + + if (nmap_enabled > 0){ + tempTangent = tangent; + tempBinormal = binormal; + } + + VTangent = normalize(gl_NormalMatrix * tempTangent); + VBinormal = normalize(gl_NormalMatrix * tempBinormal); + vec3 t = tempTangent; + vec3 b = tempBinormal; // Super hack: if diffuse material alpha is less than 1, assume a // transparency animation is at work diff --git a/Shaders/ubershader-gbuffer.frag b/Shaders/ubershader-gbuffer.frag index 12732ae51..043b1c551 100644 --- a/Shaders/ubershader-gbuffer.frag +++ b/Shaders/ubershader-gbuffer.frag @@ -3,6 +3,7 @@ // Authors: Frederic Bouvier and Gijs de Rooy // with major additions and revisions by // Emilian Huminiuc and Vivian Meazza 2011 +#version 120 varying vec3 rawpos; varying vec3 VNormal; @@ -27,7 +28,6 @@ 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 int dirt_multi; @@ -80,7 +80,7 @@ void main (void) float pf; ///BEGIN bump - if (nmap_enabled > 0 && shader_qual > 2){ + if (nmap_enabled > 0){ N = nmap.rgb * 2.0 - 1.0; N = normalize(N.x * VTangent + N.y * VBinormal + N.z * VNormal); if (nmap_dds > 0) @@ -100,7 +100,7 @@ void main (void) //////////////////////////////////////////////////////////////////// //BEGIN reflect //////////////////////////////////////////////////////////////////// - if (refl_enabled > 0 && shader_qual > 1){ + if (refl_enabled > 0){ float reflFactor; float transparency_offset = clamp(refl_correction, -1.0, 1.0);// set the user shininess offset if(refl_map > 0){ @@ -163,7 +163,7 @@ void main (void) vec3 lightmapcolor; vec4 lightmapFactor = vec4(lightmap_r_factor, lightmap_g_factor, lightmap_b_factor, lightmap_a_factor); lightmapFactor = lightmapFactor * lightmapTexel; - if (lightmap_multi >0 ){ + if (lightmap_multi > 0 ){ lightmapcolor = lightmap_r_color * lightmapFactor.r + lightmap_g_color * lightmapFactor.g + lightmap_b_color * lightmapFactor.b + diff --git a/Shaders/ubershader-lightfield.frag b/Shaders/ubershader-lightfield.frag index 6caf3838c..50b179f7f 100644 --- a/Shaders/ubershader-lightfield.frag +++ b/Shaders/ubershader-lightfield.frag @@ -36,7 +36,6 @@ uniform int nmap_dds; uniform int nmap_enabled; uniform int refl_enabled; uniform int refl_map; -uniform int shader_qual; uniform int grain_texture_enabled; uniform float amb_correction; @@ -218,7 +217,7 @@ void main (void) /// END grain overlay ///BEGIN bump - if (nmap_enabled > 0 && shader_qual > 2){ + if (nmap_enabled > 0){ N = nmap.rgb * 2.0 - 1.0; N = normalize(N.x * VTangent + N.y * VBinormal + N.z * VNormal); if (nmap_dds > 0) @@ -258,7 +257,7 @@ void main (void) //////////////////////////////////////////////////////////////////// //BEGIN reflect //////////////////////////////////////////////////////////////////// - if (refl_enabled > 0 && shader_qual > 1){ + if (refl_enabled > 0){ float reflFactor = 0.0; float transparency_offset = clamp(refl_correction, -1.0, 1.0);// set the user shininess offset @@ -266,7 +265,7 @@ void main (void) // map the shininess of the object with user input //float pam = (map.a * -2) + 1; //reverse map reflFactor = reflmap.a + transparency_offset; - } else if (nmap_enabled > 0 && shader_qual > 2) { + } else if (nmap_enabled > 0) { // set the reflectivity proportional to shininess with user input reflFactor = gl_FrontMaterial.shininess * 0.0078125 * nmap.a + transparency_offset; } else { @@ -331,7 +330,7 @@ void main (void) vec4 lightmapFactor = vec4(lightmap_r_factor, lightmap_g_factor, lightmap_b_factor, lightmap_a_factor); lightmapFactor = lightmapFactor * lightmapTexel; - if (lightmap_multi >0 ){ + if (lightmap_multi > 0 ){ lightmapcolor = lightmap_r_color * lightmapFactor.r + lightmap_g_color * lightmapFactor.g + lightmap_b_color * lightmapFactor.b + diff --git a/Shaders/ubershader.frag b/Shaders/ubershader.frag index 3e28e5bc3..d2f5f96d8 100644 --- a/Shaders/ubershader.frag +++ b/Shaders/ubershader.frag @@ -30,7 +30,6 @@ uniform int nmap_dds; uniform int nmap_enabled; uniform int refl_enabled; uniform int refl_map; -uniform int shader_qual; uniform float amb_correction; uniform float dirt_b_factor; @@ -73,7 +72,7 @@ void main (void) float pf = 0.0; ///BEGIN bump - if (nmap_enabled > 0 && shader_qual > 2){ + if (nmap_enabled > 0 ){ N = nmap.rgb * 2.0 - 1.0; N = normalize(N.x * VTangent + N.y * VBinormal + N.z * VNormal); if (nmap_dds > 0) @@ -111,7 +110,7 @@ void main (void) //////////////////////////////////////////////////////////////////// //BEGIN reflect //////////////////////////////////////////////////////////////////// - if (refl_enabled > 0 && shader_qual > 1){ + if (refl_enabled > 0 ){ float reflFactor = 0.0; float transparency_offset = clamp(refl_correction, -1.0, 1.0);// set the user shininess offset @@ -119,7 +118,7 @@ void main (void) // map the shininess of the object with user input //float pam = (map.a * -2) + 1; //reverse map reflFactor = reflmap.a + transparency_offset; - } else if (nmap_enabled > 0 && shader_qual > 2) { + } else if (nmap_enabled > 0) { // set the reflectivity proportional to shininess with user input reflFactor = gl_FrontMaterial.shininess * 0.0078125 * nmap.a + transparency_offset; } else { @@ -182,7 +181,7 @@ void main (void) vec4 lightmapFactor = vec4(lightmap_r_factor, lightmap_g_factor, lightmap_b_factor, lightmap_a_factor); lightmapFactor = lightmapFactor * lightmapTexel; - if (lightmap_multi >0 ){ + if (lightmap_multi > 0 ){ lightmapcolor = lightmap_r_color * lightmapFactor.r + lightmap_g_color * lightmapFactor.g + lightmap_b_color * lightmapFactor.b + diff --git a/Shaders/ubershader.vert b/Shaders/ubershader.vert index 2b4b516ed..23687cb1b 100644 --- a/Shaders/ubershader.vert +++ b/Shaders/ubershader.vert @@ -52,19 +52,23 @@ void main(void) //fog_Func(fogType); VNormal = normalize(gl_NormalMatrix * gl_Normal); - if (nmap_enabled > 0 && shader_qual > 2){ - VTangent = normalize(gl_NormalMatrix * tangent); - VBinormal = normalize(gl_NormalMatrix * binormal); - } else { - VTangent = vec3(0.0); - VBinormal = vec3 (0.0); - } - vec3 n = normalize(gl_Normal); - vec3 t = cross(n, vec3(1.0,0.0,0.0)); - vec3 b = cross(n,t); - // Super hack: if diffuse material alpha is less than 1, assume a - // transparency animation is at work + vec3 n = normalize(gl_Normal); + vec3 tempTangent = cross(n, vec3(1.0,0.0,0.0)); + vec3 tempBinormal = cross(n, tempTangent); + + if (nmap_enabled > 0){ + tempTangent = tangent; + tempBinormal = binormal; + } + + VTangent = normalize(gl_NormalMatrix * tempTangent); + VBinormal = normalize(gl_NormalMatrix * tempBinormal); + vec3 t = tempTangent; + vec3 b = tempBinormal; + + // Super hack: if diffuse material alpha is less than 1, assume a + // transparency animation is at work if (gl_FrontMaterial.diffuse.a < 1.0) alpha = gl_FrontMaterial.diffuse.a; else @@ -76,7 +80,7 @@ void main(void) vViewVec.y = dot(b, vertVec); vViewVec.z = dot(n, vertVec); - // calculate the reflection vector + // calculate the reflection vector vec4 reflect_eye = vec4(reflect(vertVec, VNormal), 0.0); vec3 reflVec_stat = normalize(gl_ModelViewMatrixInverse * reflect_eye).xyz; if (refl_dynamic > 0){ diff --git a/gui/dialogs/shaders.xml b/gui/dialogs/shaders.xml index 212f4b772..4bdfc82f7 100644 --- a/gui/dialogs/shaders.xml +++ b/gui/dialogs/shaders.xml @@ -230,9 +230,9 @@ model 0.0 - 3.0 + 1.0 1.0 - 0.25 + 0.5 true /sim/rendering/shaders/model