1
0
Fork 0

Quality slider overwrites custom shader settings. All effects now listen to the new sim/rendering/shaders/<foo> properties.

This commit is contained in:
Gijs de Rooy 2011-12-12 17:04:36 +01:00
parent ab07a5c333
commit 6c971211b8
22 changed files with 104 additions and 59 deletions

View file

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

View file

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

View file

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

View file

@ -9,13 +9,13 @@
<material> <material>
<color-mode-uniform>1</color-mode-uniform> <!-- DIFFUSE --> <color-mode-uniform>1</color-mode-uniform> <!-- DIFFUSE -->
</material> </material>
<condition><use>/sim/rendering/shader-effects</use></condition> <condition><use>/sim/rendering/shader/generic</use></condition>
<factor>1</factor> <factor>1</factor>
</parameters> </parameters>
<technique n="10"> <technique n="10">
<predicate> <predicate>
<and> <and>
<property>/sim/rendering/shader-effects</property> <property>/sim/rendering/shaders/generic</property>
<or> <or>
<less-equal> <less-equal>
<value type="float">2.0</value> <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> <use>/environment/terminator-relative-position-m</use>
</terminator> </terminator>
<fogtype> <fogtype>
<use>/sim/rendering/scattering-shader</use> <use>/sim/rendering/shaders/skydome</use>
</fogtype> </fogtype>
<!-- END fog include --> <!-- END fog include -->
</parameters> </parameters>
@ -147,7 +147,6 @@ please see Docs/README.model-combined.eff for documentation
<predicate> <predicate>
<and> <and>
<property>/sim/rendering/shaders/model</property> <property>/sim/rendering/shaders/model</property>
<property>/sim/rendering/shaders/quality-level</property>
<or> <or>
<less-equal> <less-equal>
<value type="float">2.0</value> <value type="float">2.0</value>

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -171,7 +171,7 @@
<checkbox> <checkbox>
<halign>left</halign> <halign>left</halign>
<label>Random objects (triggers scenery reload)</label> <label>Random objects</label>
<name>random-objects</name> <name>random-objects</name>
<property>/sim/rendering/random-objects</property> <property>/sim/rendering/random-objects</property>
<binding> <binding>
@ -342,6 +342,21 @@
</hrule> </hrule>
</group> </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> <group>
<layout>hbox</layout> <layout>hbox</layout>
@ -375,9 +390,6 @@
<layout>hbox</layout> <layout>hbox</layout>
<button> <button>
<legend>Shader Options</legend> <legend>Shader Options</legend>
<enable>
<property>/sim/rendering/shaders/quality-level</property>
</enable>
<binding> <binding>
<command>dialog-show</command> <command>dialog-show</command>
<dialog-name>shaders</dialog-name> <dialog-name>shaders</dialog-name>
@ -399,7 +411,6 @@
<green>0.6</green> <green>0.6</green>
<blue>0.6</blue> <blue>0.6</blue>
</color> </color>
</text> </text>
<text> <text>
<visible> <visible>
@ -604,6 +615,25 @@
<nasal> <nasal>
<open> <open>
gui.enable_widgets(cmdarg(), "shadows-debug", getprop("/sim/gui/devel-widgets")); 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> </open>
</nasal> </nasal>
</PropertyList> </PropertyList>

View file

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

View file

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