diff --git a/Effects/building.eff b/Effects/building.eff index aa2175da5..65a599a42 100644 --- a/Effects/building.eff +++ b/Effects/building.eff @@ -66,7 +66,7 @@ 1.0 1.0 1.0 1.0 0.0 0.0 0.0 1.0 0.02 0.02 0.02 1.0 - 0.0 + 0.1 ambient-and-diffuse ambient-and-diffuse diff --git a/Shaders/runway-gbuffer.frag b/Shaders/runway-gbuffer.frag index 7cfb15154..42def8f40 100644 --- a/Shaders/runway-gbuffer.frag +++ b/Shaders/runway-gbuffer.frag @@ -50,12 +50,14 @@ void main (void) if (normalmap_dds > 0) N = -N; + float nFactor = 1.0 - N.z; float lightness = dot(texel.rgb, vec3( 0.3, 0.59, 0.11 )); // calculate the specular light float refl_correction = spec_adjust * 2.5 - 1.0; - float shininess = max (0.35, refl_correction) * nmap.a; + float shininess = max (0.35, refl_correction) * nmap.a * nFactor; - float specular = dot(vec3(1.0) * lightness , vec3( 0.3, 0.59, 0.11 )); + + float specular = dot(vec3(1.0) * lightness , vec3( 0.3, 0.59, 0.11 )) * nFactor; vec4 color = vec4(1.0); @@ -65,7 +67,7 @@ void main (void) vec3 viewVec = normalize(vViewVec); // Map a rainbowish color - float v = dot(viewVec, normalize(VNormal)); + float v = abs(dot(viewVec, normalize(VNormal))); vec4 rainbow = texture2D(Rainbow, vec2(v, 0.0)); // Map a fresnel effect @@ -83,7 +85,7 @@ void main (void) 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 = max(map.a * (texel.r + texel.g), 1.0 - MixFactor) * nFactor + transparency_offset ; reflFactor =0.75 * smoothstep(0.05, 1.0, reflFactor); // set ambient adjustment to remove bluiness with user input @@ -96,12 +98,12 @@ void main (void) vec4 reflfrescolor = mix(reflcolor, fresnel, fresneliness * v); vec4 noisecolor = mix(reflfrescolor, noisevec, noisiness); - vec4 raincolor = vec4(noisecolor.rgb * reflFactor, 1.0); + vec4 raincolor = vec4(noisecolor.rgb * reflFactor, 1.0) * nFactor; vec4 mixedcolor = mix(texel, raincolor * (1.0 - refl_correction * (1.0 - lightness)), reflFactor); // the final reflection - vec4 fragColor = vec4(color.rgb * mixedcolor.rgb + ambient_Correction, color.a); + vec4 fragColor = vec4(color.rgb * mixedcolor.rgb + ambient_Correction * nFactor, color.a); encode_gbuffer(N, fragColor.rgb, 1, specular, shininess, emission, gl_FragCoord.z); } \ No newline at end of file diff --git a/Shaders/runway.frag b/Shaders/runway.frag index d4bb31d05..fad9defd9 100644 --- a/Shaders/runway.frag +++ b/Shaders/runway.frag @@ -79,14 +79,15 @@ void main (void) vec4 color = gl_Color + Diffuse * gl_FrontMaterial.diffuse; //color += Specular * vec4(vec3(0.5*shininess), 1.0) * nmap.a; - color += Specular * vec4(1.0) * nmap.a; + float nFactor = 1.0 - N.z; + color += Specular * vec4(1.0) * nmap.a * nFactor; color.a = texel.a * alpha; color = clamp(color, 0.0, 1.0); vec3 viewVec = normalize(vViewVec); // Map a rainbowish color - float v = dot(viewVec, normalize(VNormal)); + float v = abs(dot(viewVec, normalize(VNormal))); vec4 rainbow = texture2D(Rainbow, vec2(v, 0.0)); // Map a fresnel effect @@ -115,18 +116,18 @@ void main (void) // add fringing fresnel and rainbow effects and modulate by reflection vec4 reflcolor = mix(reflection, rainbow, rainbowiness * v); - reflcolor += Specular * nmap.a; + reflcolor += Specular * nmap.a * nFactor; 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; + raincolor += Specular * nmap.a * nFactor; vec4 mixedcolor = mix(texel, raincolor * (1.0 - refl_correction * (1.0 - lightness)), reflFactor); //* (1.0 - 0.5 * transparency_offset ) // the final reflection - vec4 fragColor = vec4(color.rgb * mixedcolor.rgb + ambient_Correction.rgb * (1.0 - refl_correction * (1.0 - 0.8 * lightness)), color.a); - fragColor += Specular * nmap.a; + vec4 fragColor = vec4(color.rgb * mixedcolor.rgb + ambient_Correction.rgb * (1.0 - refl_correction * (1.0 - 0.8 * lightness)) * nFactor, color.a); + fragColor += Specular * nmap.a * nFactor; fragColor.rgb = fog_Func(fragColor.rgb, fogType); gl_FragColor = fragColor; diff --git a/Shaders/ubershader-gbuffer.frag b/Shaders/ubershader-gbuffer.frag index 60782195b..bfd2538f8 100644 --- a/Shaders/ubershader-gbuffer.frag +++ b/Shaders/ubershader-gbuffer.frag @@ -92,7 +92,7 @@ void main (void) ///END bump vec4 reflection = textureCube(Environment, reflVec * N); vec3 viewVec = normalize(vViewVec); - float v = dot(viewVec, normalize(VNormal));// Map a rainbowish color + float v = abs(dot(viewVec, normalize(VNormal)));// Map a rainbowish color vec4 fresnel = texture2D(ReflFresnelTex, vec2(v, 0.0)); vec4 rainbow = texture2D(ReflRainbowTex, vec2(v, 0.0)); vec4 color = gl_Color * gl_FrontMaterial.diffuse; diff --git a/Shaders/ubershader.frag b/Shaders/ubershader.frag index 6e135e8aa..51df2d02a 100644 --- a/Shaders/ubershader.frag +++ b/Shaders/ubershader.frag @@ -85,7 +85,7 @@ void main (void) ///END bump vec4 reflection = textureCube(Environment, reflVec * dot(N,VNormal)); vec3 viewVec = normalize(vViewVec); - float v = dot(viewVec, normalize(VNormal));// Map a rainbowish color + float v = abs(dot(viewVec, normalize(VNormal)));// Map a rainbowish color vec4 fresnel = texture2D(ReflFresnelTex, vec2(v, 0.0)); vec4 rainbow = texture2D(ReflRainbowTex, vec2(v, 0.0));