1
0
Fork 0

Merge branch 'master' of gitorious.org:fg/fgdata

This commit is contained in:
Stuart Buchanan 2011-12-27 23:10:35 +00:00
commit 093248ca3c
3 changed files with 61 additions and 56 deletions

View file

@ -144,6 +144,27 @@ void main (void)
//END reflect
/////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//begin DIRT
//////////////////////////////////////////////////////////////////////
if (dirt_enabled > 0.0){
float dirtFactorR = reflmap.r * dirt_r_factor;
dirtFactorR = smoothstep(0.0, 1.0, dirtFactorR);
mixedcolor.rgb = mix(mixedcolor.rgb, dirt_r_color, dirtFactorR);
if (dirt_multi > 0) {
float dirtFactorG = reflmap.g * dirt_g_factor;
float dirtFactorB = reflmap.b * dirt_b_factor;
dirtFactorG = smoothstep(0.0, 1.0, dirtFactorG);
dirtFactorB = smoothstep(0.0, 1.0, dirtFactorB);
mixedcolor.rgb = mix(mixedcolor.rgb, dirt_g_color, dirtFactorG);
mixedcolor.rgb = mix(mixedcolor.rgb, dirt_b_color, dirtFactorB);
}
}
//////////////////////////////////////////////////////////////////////
//END Dirt
//////////////////////////////////////////////////////////////////////
// set ambient adjustment to remove bluiness with user input
float ambient_offset = clamp(amb_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 ;
@ -152,25 +173,7 @@ 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){
float dirtFactorR = reflmap.r * dirt_r_factor;
dirtFactorR = smoothstep(0.0, 1.0, dirtFactorR);
fragColor.rgb = mix(fragColor.rgb, dirt_r_color, dirtFactorR);
if (dirt_multi > 0) {
float dirtFactorG = reflmap.g * dirt_g_factor;
float dirtFactorB = reflmap.b * dirt_b_factor;
dirtFactorG = smoothstep(0.0, 1.0, dirtFactorG);
dirtFactorB = smoothstep(0.0, 1.0, dirtFactorB);
fragColor.rgb = mix(fragColor.rgb, dirt_g_color, dirtFactorG);
fragColor.rgb = mix(fragColor.rgb, dirt_b_color, dirtFactorB);
}
}
//////////////////////////////////////////////////////////////////////
//END Dirt
//////////////////////////////////////////////////////////////////////
fragColor += Specular * nmap.a;

View file

@ -17,9 +17,8 @@
<enabled>false</enabled>
<legend>ICAO</legend>
<binding>
<command>property-assign</command>
<property>/sim/atc/freq-airport</property>
<value type="string">ICAO</value>
<command>ATC-freq-display</command>
<icao type="string">ICAO</icao>
</binding>
<binding>
<command>dialog-close</command>
@ -60,6 +59,9 @@
<binding>
<command>dialog-apply</command>
</binding>
<binding>
<command>ATC-freq-display</command>
</binding>
<binding>
<command>dialog-close</command>
</binding>