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

@ -88,7 +88,7 @@ please see Docs/README.model-combined.eff for documentation
<internal-format>normalized</internal-format>
</texture>
<reflection-noise type="float">0.25</reflection-noise>
<!-- END Reflection -->
<!-- END Reflection -->
<!-- Dirt -->
<dirt-enabled type="int">0</dirt-enabled>
<dirt-multi type="int">0</dirt-multi>
@ -100,7 +100,7 @@ please see Docs/README.model-combined.eff for documentation
<dirt-factor type="float" n="2">0.0</dirt-factor>
<!-- ambient correction -->
<ambient-correction type="float">0.05</ambient-correction>
<!-- quality slider -->
<!-- quality slider -->
<shader-quality type="int">
<use>/sim/rendering/shaders/model</use>
</shader-quality>
@ -110,7 +110,7 @@ please see Docs/README.model-combined.eff for documentation
<bin-number>1</bin-number>
<bin-name>RenderBin</bin-name>
</render-bin>
<!-- INTERNAL USE -->
<!-- INTERNAL USE -->
<shade-model>smooth</shade-model>
<model-hdg>
<use>orientation/model/heading-deg</use>
@ -121,7 +121,7 @@ please see Docs/README.model-combined.eff for documentation
<model-roll>
<use>orientation/model/roll-deg</use>
</model-roll>
<!-- fog include -->
<!-- fog include -->
<visibility>
<use>/environment/ground-visibility-m</use>
</visibility>
@ -140,7 +140,7 @@ please see Docs/README.model-combined.eff for documentation
<fogtype>
<use>/sim/rendering/shaders/skydome</use>
</fogtype>
<!-- END fog include -->
<!-- END fog include -->
</parameters>
<!--<generate>
@ -427,7 +427,7 @@ please see Docs/README.model-combined.eff for documentation
<value type="int">9</value>
</uniform>
<!-- NORMAL MAP -->
<!-- NORMAL MAP -->
<!-- normalmap is used-->
<uniform>
<name>nmap_enabled</name>
@ -454,8 +454,8 @@ please see Docs/README.model-combined.eff for documentation
</value>
</uniform>
<!-- LIGHTMAP -->
<!-- lightmap is used -->
<!-- LIGHTMAP -->
<!-- lightmap is used -->
<uniform>
<name>lightmap_enabled</name>
<type>int</type>
@ -463,7 +463,7 @@ please see Docs/README.model-combined.eff for documentation
<use>lightmap-enabled</use>
</value>
</uniform>
<!-- lightmap is multichannel -->
<!-- lightmap is multichannel -->
<uniform>
<name>lightmap_multi</name>
<type>int</type>
@ -536,7 +536,7 @@ please see Docs/README.model-combined.eff for documentation
</value>
</uniform>
<!-- reflection is used -->
<!-- reflection is used -->
<uniform>
<name>refl_enabled</name>
<type>int</type>
@ -544,7 +544,7 @@ please see Docs/README.model-combined.eff for documentation
<use>reflection-enabled</use>
</value>
</uniform>
<!-- reflection correction -->
<!-- reflection correction -->
<uniform>
<name>refl_correction</name>
<type>float</type>
@ -561,7 +561,7 @@ please see Docs/README.model-combined.eff for documentation
<use>reflect-map-enabled</use>
</value>
</uniform>
<!-- reflection is dynamic -->
<!-- reflection is dynamic -->
<uniform>
<name>refl_dynamic</name>
<type>int</type>
@ -670,7 +670,7 @@ please see Docs/README.model-combined.eff for documentation
<use>ambient-correction</use>
</value>
</uniform>
<!-- shader quality -->
<!-- shader quality -->
<uniform>
<name>shader_qual</name>
<type>int</type>

View file

@ -140,9 +140,30 @@ void main (void)
} else {
mixedcolor = texel.rgb;
}
/////////////////////////////////////////////////////////////////////
//END reflect
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
//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);
@ -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>