1
0
Fork 0

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

This commit is contained in:
BARANGER Emmanuel 2011-12-13 16:02:06 +01:00
commit 8218cf2580
26 changed files with 119 additions and 72 deletions

View file

@ -109,7 +109,7 @@
<use>/environment/terminator-relative-position-m</use>
</terminator>
<fogtype>
<use>/sim/rendering/scattering-shader</use>
<use>/sim/rendering/shaders/skydome</use>
</fogtype>
<!-- END fog include -->
</parameters>
@ -117,10 +117,9 @@
<predicate>
<and>
<property>/sim/rendering/shaders/water</property>
<!--<property>/sim/rendering/shader-effects</property>-->
<less-equal>
<value type="float">2.0</value>
<float-property>/sim/rendering/shaders/quality-level</float-property>
<float-property>/sim/rendering/shaders/water</float-property>
</less-equal>
<or>
<less-equal>
@ -492,7 +491,6 @@
<predicate>
<and>
<property>/sim/rendering/shaders/water</property>
<property>/sim/rendering/shaders/quality-level</property>
<or>
<less-equal>
<value type="float">2.0</value>

View file

@ -37,7 +37,7 @@ in Aircraft/A320/Models/Effects/a320_bumpspec.eff ( or whatever, private to the
<technique n="10">
<predicate>
<and>
<property>/sim/rendering/shader-effects</property>
<property>/sim/rendering/shaders/model</property>
<or>
<less-equal>
<value type="float">2.0</value>

View file

@ -41,7 +41,7 @@
<use>/environment/terminator-relative-position-m</use>
</terminator>
<fogtype>
<use>/sim/rendering/scattering-shader</use>
<use>/sim/rendering/shaders/skydome</use>
</fogtype>
<!-- END fog include -->
@ -49,11 +49,7 @@
<technique n="9">
<predicate>
<and>
<!--<property>/sim/rendering/shader-effects</property>-->
<less-equal>
<value type="float">3.0</value>
<float-property>/sim/rendering/shaders/quality-level</float-property>
</less-equal>
<property>/sim/rendering/shaders/generic</property>
<or>
<less-equal>
<value type="float">2.0</value>

View file

@ -16,7 +16,7 @@
<depth-factor type="float">0.01</depth-factor>
<canopy-height type="float">15.0</canopy-height>
<quality-level>
<use>/sim/rendering/shaders/quality-level</use>
<use>/sim/rendering/shaders/landmass</use>
</quality-level>
</parameters>
@ -37,7 +37,7 @@
<use>/environment/terminator-relative-position-m</use>
</terminator>
<fogtype>
<use>/sim/rendering/scattering-shader</use>
<use>/sim/rendering/shaders/skydome</use>
</fogtype>
<!-- END fog include -->
@ -50,8 +50,8 @@
<and>
<property>/sim/rendering/shaders/landmass</property>
<less-equal>
<value type="float">4.5</value>
<float-property>/sim/rendering/shaders/quality-level</float-property>
<value type="float">4.0</value>
<float-property>/sim/rendering/shaders/landmass</float-property>
</less-equal>
<or>
<less-equal>

View file

@ -9,13 +9,13 @@
<material>
<color-mode-uniform>1</color-mode-uniform> <!-- DIFFUSE -->
</material>
<condition><use>/sim/rendering/shader-effects</use></condition>
<condition><use>/sim/rendering/shader/generic</use></condition>
<factor>1</factor>
</parameters>
<technique n="10">
<predicate>
<and>
<property>/sim/rendering/shader-effects</property>
<property>/sim/rendering/shaders/generic</property>
<or>
<less-equal>
<value type="float">2.0</value>

View file

@ -133,7 +133,7 @@ please see Docs/README.model-combined.eff for documentation
<use>/environment/terminator-relative-position-m</use>
</terminator>
<fogtype>
<use>/sim/rendering/scattering-shader</use>
<use>/sim/rendering/shaders/skydome</use>
</fogtype>
<!-- END fog include -->
</parameters>
@ -147,7 +147,6 @@ please see Docs/README.model-combined.eff for documentation
<predicate>
<and>
<property>/sim/rendering/shaders/model</property>
<property>/sim/rendering/shaders/quality-level</property>
<or>
<less-equal>
<value type="float">2.0</value>

View file

@ -28,14 +28,14 @@
<use>/environment/terminator-relative-position-m</use>
</terminator>
<fogtype>
<use>/sim/rendering/scattering-shader</use>
<use>/sim/rendering/shaders/skydome</use>
</fogtype>
<!-- END fog include -->
</parameters>
<technique n="10">
<predicate>
<and>
<property>/sim/rendering/shader-effects</property>
<property>/sim/rendering/shaders/generic</property>
<or>
<less-equal>
<value type="float">2.0</value>

View file

@ -8,7 +8,7 @@
<technique n="10">
<predicate>
<and>
<property>/sim/rendering/shader-effects</property>
<property>/sim/rendering/clouds3d-enable</property>
<less-equal>
<value type="float">1.0</value>
<shader-language/>

View file

@ -123,7 +123,7 @@ EXAMPLES: You can find examples of both usages in the Hunter and Lightning model
<use>/environment/terminator-relative-position-m</use>
</terminator>
<fogtype>
<use>/sim/rendering/scattering-shader</use>
<use>/sim/rendering/shaders/skydome</use>
</fogtype>
</parameters>
@ -135,7 +135,7 @@ EXAMPLES: You can find examples of both usages in the Hunter and Lightning model
<technique n="9">
<predicate>
<and>
<property>/sim/rendering/shader-effects</property>
<property>/sim/rendering/shaders/model</property>
<or>
<less-equal>
<value type="float">2.0</value>

View file

@ -114,7 +114,7 @@
<predicate>
<and>
<property>/sim/rendering/shader-effects</property>
<property>/sim/rendering/shaders/model</property>
<or>
<less-equal>
<value type="float">2.0</value>

View file

@ -78,7 +78,7 @@
<use>/environment/terminator-relative-position-m</use>
</terminator>
<fogtype>
<use>/sim/rendering/scattering-shader</use>
<use>/sim/rendering/shaders/skydome</use>
</fogtype>
<!-- END fog include -->
</parameters>
@ -89,7 +89,7 @@
<technique n="9">
<predicate>
<and>
<property>/sim/rendering/shader-effects</property>
<property>/sim/rendering/shaders/generic</property>
<or>
<less-equal>
<value type="float">2.0</value>

View file

@ -36,7 +36,6 @@
<technique n="8">
<predicate>
<and>
<property>/sim/rendering/shaders/quality-level</property>
<property>/sim/rendering/shaders/skydome</property>
<or>
<less-equal>

View file

@ -51,7 +51,7 @@
<use>/environment/terminator-relative-position-m</use>
</terminator>
<fogtype>
<use>/sim/rendering/scattering-shader</use>
<use>/sim/rendering/shaders/skydome</use>
</fogtype>
</parameters>
<!-- put techniques at a "high" index to allow derived effects to
@ -59,7 +59,7 @@
<technique n="10">
<predicate>
<and>
<property>/sim/rendering/shader-effects</property>
<property>/sim/rendering/shaders/generic</property>
<or>
<less-equal>

View file

@ -8,7 +8,7 @@
<technique n="10">
<predicate>
<and>
<property>/sim/rendering/shader-effects</property>
<property>/sim/rendering/shaders/generic</property>
<less-equal>
<value type="float">1.0</value>
<shader-language/>

View file

@ -80,7 +80,7 @@ parameters :
<use>/environment/terminator-relative-position-m</use>
</terminator>
<fogtype>
<use>/sim/rendering/scattering-shader</use>
<use>/sim/rendering/shaders/skydome</use>
</fogtype>
<!-- END fog include -->
</parameters>
@ -94,7 +94,6 @@ parameters :
<predicate>
<and>
<property>/sim/rendering/shaders/transition</property>
<property>/sim/rendering/shaders/quality-level</property>
<or>
<less-equal>
<value type="float">2.0</value>

View file

@ -33,14 +33,13 @@
<use>/environment/terminator-relative-position-m</use>
</terminator>
<fogtype>
<use>/sim/rendering/scattering-shader</use>
<use>/sim/rendering/shaders/skydome</use>
</fogtype>
<!-- END fog include -->
</parameters>
<technique n="10">
<predicate>
<and>
<!--<property>/sim/rendering/shader-effects</property>-->
<property>/sim/rendering/random-vegetation</property>
<less-equal>
<value type="float">1.0</value>

View file

@ -29,7 +29,7 @@
<use>/environment/terminator-relative-position-m</use>
</terminator>
<fogtype>
<use>/sim/rendering/scattering-shader</use>
<use>/sim/rendering/shaders/skydome</use>
</fogtype>
<!-- END fog include -->
@ -43,7 +43,6 @@
<predicate>
<and>
<property>/sim/rendering/shaders/urban</property>
<property>/sim/rendering/shaders/quality-level</property>
<less-equal>
<value type="float">4.0</value>
<float-property>/sim/rendering/shaders/urban</float-property>
@ -288,10 +287,9 @@
<predicate>
<and>
<property>/sim/rendering/shaders/urban</property>
<!--<property>/sim/rendering/shader-effects</property>-->
<less-equal>
<value type="float">2.0</value>
<float-property>/sim/rendering/shaders/quality-level</float-property>
<float-property>/sim/rendering/shaders/urban</float-property>
</less-equal>
<or>
<less-equal>

View file

@ -66,18 +66,17 @@
<use>/environment/terminator-relative-position-m</use>
</terminator>
<fogtype>
<use>/sim/rendering/scattering-shader</use>
<use>/sim/rendering/shaders/skydome</use>
</fogtype>
<!-- END fog include -->
</parameters>
<technique n="8">
<predicate>
<and>
<property>/sim/rendering/water-shader</property>
<property>/sim/rendering/shader-effects</property>
<property>/sim/rendering/shaders/water</property>
<less-equal>
<value type="float">2.0</value>
<float-property>/sim/rendering/quality-level</float-property>
<float-property>/sim/rendering/shaders/water</float-property>
</less-equal>
<or>
<less-equal>
@ -310,8 +309,7 @@
<technique n="9">
<predicate>
<and>
<property>/sim/rendering/water-shader</property>
<property>/sim/rendering/shader-effects</property>
<property>/sim/rendering/shaders/water</property>
<or>
<less-equal>
<value type="float">2.0</value>

View file

@ -125,7 +125,7 @@
<use>/environment/terminator-relative-position-m</use>
</terminator>
<fogtype>
<use>/sim/rendering/scattering-shader</use>
<use>/sim/rendering/shaders/skydome</use>
</fogtype>
<!-- END fog include -->
</parameters>

View file

@ -12,6 +12,7 @@ $Id$
<PropertyList>
<name>applesmc</name>
<name>ST LIS3LV02DL Accelerometer</name>
<name>ST LIS3L V02DL Accelerometer</name>

View file

@ -1,7 +1,7 @@
// -*-C++-*-
// Texture switching based on face slope and snow level
// based on earlier work by Frederic Bouvier, Tim Moore, and Yves Sablonier.
// Š Emilian Huminiuc 2011
// <EFBFBD> Emilian Huminiuc 2011
// Ambient term comes in gl_Color.rgb.
varying vec4 diffuse_term, RawPos;
@ -35,7 +35,7 @@ void main()
Noise = texture3D(NoiseTex, RawPos.xyz*0.0011);
MixFactor = Noise.r * Noise.g * Noise.b; //Mixing Factor to create a more organic looking boundary
MixFactor *= 300;
MixFactor *= 300.0;
MixFactor = clamp(MixFactor, 0.0, 1.0);
L1 = 0.90 - 0.02 * MixFactor; //first transition slope
L2 = 0.78 + 0.04 * MixFactor; //Second transition slope
@ -67,9 +67,9 @@ void main()
//pull the texture fetch outside flow control to fix aliasing artefacts :(
vec4 baseTexel = texture2D(BaseTex, gl_TexCoord[0].st);
vec4 secondTexel = texture2D(SecondTex, gl_TexCoord[0].st);
vec4 thirdTexel = texture2D(ThirdTex, gl_TexCoord[0].st);
vec4 snowTexel = texture2D(SnowTex, gl_TexCoord[0].st * 2);
vec4 secondTexel = texture2D(SecondTex, gl_TexCoord[0].st);
vec4 thirdTexel = texture2D(ThirdTex, gl_TexCoord[0].st);
vec4 snowTexel = texture2D(SnowTex, gl_TexCoord[0].st);
//Normal transition. For more abrupt faces apply another texture (or 2).
if (InverseSlope == 0.0) {
//Do we do an intermediate transition
@ -123,10 +123,10 @@ void main()
texel.rgb = texel.rgb * wetness;
float altitude = RawPos.z;
//Snow texture for areas higher than SnowLevel
if (RawPos.z >= SnowLevel - (1000.0 * slope + 300 * MixFactor) && slope > L2 - 0.12) {
texel = mix(texel, mix(texel, snowTexel, smoothstep(L2 - 0.09 * MixFactor, L2, slope)), smoothstep(SnowLevel - (1000.0 * slope + 300 * MixFactor), SnowLevel - (1000 * slope - 150 * MixFactor), RawPos.z));
if (altitude >= SnowLevel - (1000.0 * slope + 300.0 * MixFactor) && slope > L2 - 0.12) {
texel = mix(texel, mix(texel, snowTexel, smoothstep(L2 - 0.09 * MixFactor, L2, slope)), smoothstep(SnowLevel - (1000.0 * slope + 300.0 * MixFactor), SnowLevel - (1000.0 * slope - 150.0 * MixFactor), altitude));
}
fragColor = color * texel + specular;
@ -139,6 +139,7 @@ void main()
}
//fogFactor = exp(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord);
fragColor.rgb *= 1.2 - 0.4 * MixFactor;
fragColor.rgb = fog_Func(fragColor.rgb, fogType);
//gl_FragColor = mix(gl_Fog.color, fragColor, fogFactor);
gl_FragColor = fragColor;

View file

@ -69,7 +69,7 @@ void main (void)
float pf;
///BEGIN bump
if (nmap_enabled > 0 && shader_qual > 1){
if (nmap_enabled > 0 && shader_qual > 2){
N = nmap.rgb * 2.0 - 1.0;
N = normalize(N.x * VTangent + N.y * VBinormal + N.z * VNormal);
if (nmap_dds > 0)
@ -107,7 +107,7 @@ void main (void)
////////////////////////////////////////////////////////////////////
//BEGIN reflect
////////////////////////////////////////////////////////////////////
if (refl_enabled > 0 && shader_qual > 0){
if (refl_enabled > 0 && shader_qual > 1){
float reflFactor;
float transparency_offset = clamp(refl_correction, -1.0, 1.0);// set the user shininess offset
@ -115,7 +115,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 > 1) {
} else if (nmap_enabled > 0 && shader_qual > 2) {
// set the reflectivity proportional to shininess with user input
reflFactor = (gl_FrontMaterial.shininess / 128.0) * nmap.a + transparency_offset;
} else {

View file

@ -50,7 +50,7 @@ void main(void)
fog_Func(fogType);
VNormal = normalize(gl_NormalMatrix * gl_Normal);
if (nmap_enabled > 0 && shader_qual > 1){
if (nmap_enabled > 0 && shader_qual > 2){
VTangent = normalize(gl_NormalMatrix * tangent);
VBinormal = normalize(gl_NormalMatrix * binormal);
} else {

View file

@ -171,7 +171,7 @@
<checkbox>
<halign>left</halign>
<label>Random objects (triggers scenery reload)</label>
<label>Random objects</label>
<name>random-objects</name>
<property>/sim/rendering/random-objects</property>
<binding>
@ -342,6 +342,21 @@
</hrule>
</group>
<group>
<layout>vbox</layout>
<padding>4</padding>
<text>
<padding>0</padding>
<label>This slider overrides custom settings as set in</label>
<halign>left</halign>
</text>
<text>
<padding>0</padding>
<label>the (advanced) Shader Options dialog.</label>
<halign>left</halign>
</text>
</group>
<group>
<layout>hbox</layout>
@ -375,9 +390,6 @@
<layout>hbox</layout>
<button>
<legend>Shader Options</legend>
<enable>
<property>/sim/rendering/shaders/quality-level</property>
</enable>
<binding>
<command>dialog-show</command>
<dialog-name>shaders</dialog-name>
@ -399,7 +411,6 @@
<green>0.6</green>
<blue>0.6</blue>
</color>
</text>
<text>
<visible>
@ -604,6 +615,25 @@
<nasal>
<open>
gui.enable_widgets(cmdarg(), "shadows-debug", getprop("/sim/gui/devel-widgets"));
# overwrite custom shader settings on quality-slider input
_setlistener("/sim/rendering/shaders/quality-level", func {
var qualityLevel = getprop("/sim/rendering/shaders/quality-level");
setprop("/sim/rendering/shaders/landmass",qualityLevel);
setprop("/sim/rendering/shaders/urban",qualityLevel);
setprop("/sim/rendering/shaders/water",qualityLevel);
if (qualityLevel >= 1.0){
qualityLevel = 1.0;
}
else {
qualityLevel = 0.0;
}
setprop("/sim/rendering/shaders/contrails",qualityLevel);
setprop("/sim/rendering/shaders/crop",qualityLevel);
setprop("/sim/rendering/shaders/generic",qualityLevel);
setprop("/sim/rendering/shaders/model",qualityLevel);
setprop("/sim/rendering/shaders/transition",qualityLevel);
});
</open>
</nasal>
</PropertyList>

View file

@ -52,6 +52,14 @@
<layout>vbox</layout>
<halign>left</halign>
<text>
<halign>left</halign>
<label>Generic</label>
<enable>
<property>/sim/rendering/shaders/generic</property>
</enable>
</text>
<text>
<halign>left</halign>
<label>Crop</label>
@ -108,18 +116,32 @@
</enable>
</text>
</group>
<group>
<layout>vbox</layout>
<slider>
<name>generic</name>
<min>0.0</min>
<max>1.0</max>
<step>1.0</step>
<fraction>0.5</fraction>
<live>true</live>
<property>/sim/rendering/shaders/generic</property>
<binding>
<command>dialog-apply</command>
<object-name>generic</object-name>
</binding>
</slider>
<slider>
<name>crop</name>
<min>0.0</min>
<max>1.0</max>
<step>1.0</step>
<fraction>0.5</fraction>
<live>true</live>
<property>/sim/rendering/shaders/crop</property>
<binding>
<command>dialog-apply</command>
@ -130,9 +152,10 @@
<slider>
<name>landmass</name>
<min>0.0</min>
<max>1.0</max>
<max>5.0</max>
<step>1.0</step>
<fraction>0.5</fraction>
<fraction>0.17</fraction>
<live>true</live>
<property>/sim/rendering/shaders/landmass</property>
<binding>
<command>dialog-apply</command>
@ -146,6 +169,7 @@
<max>1.0</max>
<step>1.0</step>
<fraction>0.5</fraction>
<live>true</live>
<property>/sim/rendering/shaders/contrails</property>
<binding>
<command>dialog-apply</command>
@ -159,6 +183,7 @@
<max>1.0</max>
<step>1.0</step>
<fraction>0.5</fraction>
<live>true</live>
<property>/sim/rendering/shaders/transition</property>
<binding>
<command>dialog-apply</command>
@ -169,9 +194,10 @@
<slider>
<name>model</name>
<min>0.0</min>
<max>1.0</max>
<max>3.0</max>
<step>1.0</step>
<fraction>0.5</fraction>
<fraction>0.25</fraction>
<live>true</live>
<property>/sim/rendering/shaders/model</property>
<binding>
<command>dialog-apply</command>
@ -185,6 +211,7 @@
<max>5.0</max>
<step>1.0</step>
<fraction>0.17</fraction>
<live>true</live>
<property>/sim/rendering/shaders/urban</property>
<binding>
<command>dialog-apply</command>
@ -198,6 +225,7 @@
<max>5.0</max>
<step>1.0</step>
<fraction>0.17</fraction>
<live>true</live>
<property>/sim/rendering/shaders/water</property>
<binding>
<command>dialog-apply</command>

View file

@ -68,10 +68,11 @@ Started September 2000 by David Megginson, david@megginson.com
<realism type="int">5</realism>
<filtering type="int">8</filtering>
<shaders>
<model type="float" userarchive="y">1.0</model>
<crop type="float" userarchive="y">1.0</crop>
<generic type="float" userarchive="y">1.0</generic>
<landmass type="float" userarchive="y">1.0</landmass>
<model type="float" userarchive="y">1.0</model>
<contrails type="float" userarchive="y">1.0</contrails>
<crop type="float" userarchive="y">1.0</crop>
<skydome type="bool" userarchive="y">false</skydome>
<transition type="float" userarchive="y">1.0</transition>
<urban type="float" userarchive="y">1.0</urban>