Add anti-aliasing controls to the rendering dialog
This commit is contained in:
parent
14e167a6e2
commit
4f6edde3e9
8 changed files with 102 additions and 35 deletions
|
@ -19,10 +19,9 @@ particular list.
|
||||||
<PropertyList>
|
<PropertyList>
|
||||||
|
|
||||||
<save-to-file>
|
<save-to-file>
|
||||||
<!-- Rendering modes -->
|
<!-- General -->
|
||||||
<property>/sim/rendering/shaders/skydome</property>
|
<property>/sim/rendering/shaders/skydome</property>
|
||||||
<property>/sim/rendering/shaders/use-shaders</property>
|
<property>/sim/rendering/shaders/use-shaders</property>
|
||||||
<!-- ALS shaders -->
|
|
||||||
<property>/sim/rendering/shaders/landmass</property>
|
<property>/sim/rendering/shaders/landmass</property>
|
||||||
<property>/sim/rendering/shaders/transition</property>
|
<property>/sim/rendering/shaders/transition</property>
|
||||||
<property>/sim/rendering/shaders/model</property>
|
<property>/sim/rendering/shaders/model</property>
|
||||||
|
@ -30,6 +29,8 @@ particular list.
|
||||||
<property>/sim/rendering/shaders/clouds</property>
|
<property>/sim/rendering/shaders/clouds</property>
|
||||||
<property>/sim/rendering/shaders/wind-effects</property>
|
<property>/sim/rendering/shaders/wind-effects</property>
|
||||||
<property>/sim/rendering/shaders/vegetation-effects</property>
|
<property>/sim/rendering/shaders/vegetation-effects</property>
|
||||||
|
<property>/sim/rendering/multi-sample-buffers</property>
|
||||||
|
<property>/sim/rendering/multi-samples</property>
|
||||||
<!-- Shadows -->
|
<!-- Shadows -->
|
||||||
<property>/sim/rendering/shadows/enabled</property>
|
<property>/sim/rendering/shadows/enabled</property>
|
||||||
<property>/sim/rendering/shadows/sun-atlas-size</property>
|
<property>/sim/rendering/shadows/sun-atlas-size</property>
|
||||||
|
@ -84,6 +85,8 @@ particular list.
|
||||||
</compositor-reload-required>
|
</compositor-reload-required>
|
||||||
|
|
||||||
<restart-required>
|
<restart-required>
|
||||||
|
<property>/sim/rendering/multi-sample-buffers</property>
|
||||||
|
<property>/sim/rendering/multi-samples</property>
|
||||||
</restart-required>
|
</restart-required>
|
||||||
|
|
||||||
</PropertyList>
|
</PropertyList>
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
<wind-effects type="float">2</wind-effects>
|
<wind-effects type="float">2</wind-effects>
|
||||||
<vegetation-effects type="float">0</vegetation-effects>
|
<vegetation-effects type="float">0</vegetation-effects>
|
||||||
</shaders>
|
</shaders>
|
||||||
|
<multi-sample-buffers type="bool">true</multi-sample-buffers>
|
||||||
|
<multi-samples type="int">4</multi-samples>
|
||||||
<shadows>
|
<shadows>
|
||||||
<enabled type="bool">true</enabled>
|
<enabled type="bool">true</enabled>
|
||||||
<sun-atlas-size type="int">4096</sun-atlas-size>
|
<sun-atlas-size type="int">4096</sun-atlas-size>
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
<wind-effects type="float">0</wind-effects>
|
<wind-effects type="float">0</wind-effects>
|
||||||
<vegetation-effects type="float">0</vegetation-effects>
|
<vegetation-effects type="float">0</vegetation-effects>
|
||||||
</shaders>
|
</shaders>
|
||||||
|
<multi-sample-buffers type="bool">false</multi-sample-buffers>
|
||||||
|
<multi-samples type="int">0</multi-samples>
|
||||||
<shadows>
|
<shadows>
|
||||||
<enabled type="bool">true</enabled>
|
<enabled type="bool">true</enabled>
|
||||||
<sun-atlas-size type="int">1024</sun-atlas-size>
|
<sun-atlas-size type="int">1024</sun-atlas-size>
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
<wind-effects type="float">2</wind-effects>
|
<wind-effects type="float">2</wind-effects>
|
||||||
<vegetation-effects type="float">0</vegetation-effects>
|
<vegetation-effects type="float">0</vegetation-effects>
|
||||||
</shaders>
|
</shaders>
|
||||||
|
<multi-sample-buffers type="bool">true</multi-sample-buffers>
|
||||||
|
<multi-samples type="int">2</multi-samples>
|
||||||
<shadows>
|
<shadows>
|
||||||
<enabled type="bool">true</enabled>
|
<enabled type="bool">true</enabled>
|
||||||
<sun-atlas-size type="int">2048</sun-atlas-size>
|
<sun-atlas-size type="int">2048</sun-atlas-size>
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
<wind-effects type="float">0</wind-effects>
|
<wind-effects type="float">0</wind-effects>
|
||||||
<vegetation-effects type="float">0</vegetation-effects>
|
<vegetation-effects type="float">0</vegetation-effects>
|
||||||
</shaders>
|
</shaders>
|
||||||
|
<multi-sample-buffers type="bool">false</multi-sample-buffers>
|
||||||
|
<multi-samples type="int">0</multi-samples>
|
||||||
<shadows>
|
<shadows>
|
||||||
<enabled type="bool">false</enabled>
|
<enabled type="bool">false</enabled>
|
||||||
<sun-atlas-size type="int">1024</sun-atlas-size>
|
<sun-atlas-size type="int">1024</sun-atlas-size>
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
<wind-effects type="float">2</wind-effects>
|
<wind-effects type="float">2</wind-effects>
|
||||||
<vegetation-effects type="float">1</vegetation-effects>
|
<vegetation-effects type="float">1</vegetation-effects>
|
||||||
</shaders>
|
</shaders>
|
||||||
|
<multi-sample-buffers type="bool">true</multi-sample-buffers>
|
||||||
|
<multi-samples type="int">8</multi-samples>
|
||||||
<shadows>
|
<shadows>
|
||||||
<enabled type="bool">true</enabled>
|
<enabled type="bool">true</enabled>
|
||||||
<sun-atlas-size type="int">8192</sun-atlas-size>
|
<sun-atlas-size type="int">8192</sun-atlas-size>
|
||||||
|
|
|
@ -54,6 +54,8 @@ Started September 2000 by David Megginson, david@megginson.com
|
||||||
<rendering>
|
<rendering>
|
||||||
<initialized type="bool">false</initialized>
|
<initialized type="bool">false</initialized>
|
||||||
<materials-file>Materials/regions/materials.xml</materials-file>
|
<materials-file>Materials/regions/materials.xml</materials-file>
|
||||||
|
<multi-sample-buffers type="bool" userarchive="y">false</multi-sample-buffers>
|
||||||
|
<multi-samples type="int" userarchive="y">0</multi-samples>
|
||||||
<shadows>
|
<shadows>
|
||||||
<enabled type="bool" userarchive="y">false</enabled>
|
<enabled type="bool" userarchive="y">false</enabled>
|
||||||
<sun-atlas-size type="int" userarchive="y">2048</sun-atlas-size>
|
<sun-atlas-size type="int" userarchive="y">2048</sun-atlas-size>
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
<group>
|
<group>
|
||||||
<layout>hbox</layout>
|
<layout>hbox</layout>
|
||||||
<text>
|
<text>
|
||||||
<label>Rendering Mode</label>
|
<label>General</label>
|
||||||
<halign>left</halign>
|
<halign>left</halign>
|
||||||
</text>
|
</text>
|
||||||
<hrule>
|
<hrule>
|
||||||
|
@ -62,6 +62,20 @@
|
||||||
</hrule>
|
</hrule>
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
|
<text>
|
||||||
|
<halign>left</halign>
|
||||||
|
<label>Select Rendering Mode</label>
|
||||||
|
</text>
|
||||||
|
|
||||||
|
<!-- only for a gap -->
|
||||||
|
<group>
|
||||||
|
<layout>vbox</layout>
|
||||||
|
<default-padding>1</default-padding>
|
||||||
|
<text>
|
||||||
|
<label> </label>
|
||||||
|
</text>
|
||||||
|
</group>
|
||||||
|
|
||||||
<group>
|
<group>
|
||||||
<layout>hbox</layout>
|
<layout>hbox</layout>
|
||||||
<halign>left</halign>
|
<halign>left</halign>
|
||||||
|
@ -125,7 +139,7 @@
|
||||||
<halign>fill</halign>
|
<halign>fill</halign>
|
||||||
<stretch>true</stretch>
|
<stretch>true</stretch>
|
||||||
<pref-width>400</pref-width>
|
<pref-width>400</pref-width>
|
||||||
<pref-height>80</pref-height>
|
<pref-height>90</pref-height>
|
||||||
<slider>15</slider>
|
<slider>15</slider>
|
||||||
<editable>false</editable>
|
<editable>false</editable>
|
||||||
<wrap>true</wrap>
|
<wrap>true</wrap>
|
||||||
|
@ -169,7 +183,7 @@
|
||||||
<halign>fill</halign>
|
<halign>fill</halign>
|
||||||
<stretch>true</stretch>
|
<stretch>true</stretch>
|
||||||
<pref-width>400</pref-width>
|
<pref-width>400</pref-width>
|
||||||
<pref-height>100</pref-height>
|
<pref-height>110</pref-height>
|
||||||
<slider>15</slider>
|
<slider>15</slider>
|
||||||
<editable>false</editable>
|
<editable>false</editable>
|
||||||
<wrap>true</wrap>
|
<wrap>true</wrap>
|
||||||
|
@ -178,19 +192,22 @@
|
||||||
<property>/sim/gui/dialogs/advanced/als-description</property>
|
<property>/sim/gui/dialogs/advanced/als-description</property>
|
||||||
</textbox>
|
</textbox>
|
||||||
|
|
||||||
<group>
|
<hrule/>
|
||||||
<layout>hbox</layout>
|
|
||||||
<text>
|
<text>
|
||||||
<enable>
|
<visible>
|
||||||
|
<not>
|
||||||
<property>/sim/rendering/shaders/skydome</property>
|
<property>/sim/rendering/shaders/skydome</property>
|
||||||
</enable>
|
</not>
|
||||||
<label>ALS Shader Settings</label>
|
</visible>
|
||||||
<halign>left</halign>
|
<halign>left</halign>
|
||||||
</text>
|
<color>
|
||||||
<hrule>
|
<red>1.0</red>
|
||||||
<stretch>true</stretch>
|
<green>0.6</green>
|
||||||
</hrule>
|
<blue>0.6</blue>
|
||||||
</group>
|
</color>
|
||||||
|
<label>Some of these settings can only be changed when using ALS.</label>
|
||||||
|
</text>
|
||||||
|
|
||||||
<group>
|
<group>
|
||||||
<layout>table</layout>
|
<layout>table</layout>
|
||||||
|
@ -430,22 +447,48 @@
|
||||||
</binding>
|
</binding>
|
||||||
</combo>
|
</combo>
|
||||||
|
|
||||||
</group>
|
<text>
|
||||||
|
<row>7</row>
|
||||||
|
<col>0</col>
|
||||||
|
<halign>left</halign>
|
||||||
|
<label>Anti-aliasing</label>
|
||||||
|
</text>
|
||||||
|
<combo>
|
||||||
|
<row>7</row>
|
||||||
|
<col>1</col>
|
||||||
|
<name>anti-aliasing</name>
|
||||||
|
<pref-width>200</pref-width>
|
||||||
|
<property>/sim/gui/dialogs/advanced/anti-aliasing</property>
|
||||||
|
<value>Disabled</value>
|
||||||
|
<value>MSAA 2x</value>
|
||||||
|
<value>MSAA 4x</value>
|
||||||
|
<value>MSAA 8x</value>
|
||||||
|
<binding>
|
||||||
|
<command>dialog-apply</command>
|
||||||
|
<object-name>anti-aliasing</object-name>
|
||||||
|
</binding>
|
||||||
|
<binding>
|
||||||
|
<command>nasal</command>
|
||||||
|
<script>
|
||||||
|
var val = getprop("/sim/gui/dialogs/advanced/anti-aliasing");
|
||||||
|
if (val == "MSAA 2x") {
|
||||||
|
setprop("/sim/rendering/multi-sample-buffers", 1);
|
||||||
|
setprop("/sim/rendering/multi-samples", 2);
|
||||||
|
} else if (val == "MSAA 4x") {
|
||||||
|
setprop("/sim/rendering/multi-sample-buffers", 1);
|
||||||
|
setprop("/sim/rendering/multi-samples", 4);
|
||||||
|
} else if (val == "MSAA 8x") {
|
||||||
|
setprop("/sim/rendering/multi-sample-buffers", 1);
|
||||||
|
setprop("/sim/rendering/multi-samples", 8);
|
||||||
|
} else {
|
||||||
|
setprop("/sim/rendering/multi-sample-buffers", 0);
|
||||||
|
setprop("/sim/rendering/multi-samples", 0);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</binding>
|
||||||
|
</combo>
|
||||||
|
|
||||||
<text>
|
</group>
|
||||||
<visible>
|
|
||||||
<not>
|
|
||||||
<property>/sim/rendering/shaders/skydome</property>
|
|
||||||
</not>
|
|
||||||
</visible>
|
|
||||||
<halign>left</halign>
|
|
||||||
<color>
|
|
||||||
<red>1.0</red>
|
|
||||||
<green>0.6</green>
|
|
||||||
<blue>0.6</blue>
|
|
||||||
</color>
|
|
||||||
<label>These settings can only be changed when using ALS.</label>
|
|
||||||
</text>
|
|
||||||
|
|
||||||
<group>
|
<group>
|
||||||
<layout>vbox</layout>
|
<layout>vbox</layout>
|
||||||
|
@ -1206,7 +1249,7 @@
|
||||||
"rendering of large distances. It is recommended to run this " ~
|
"rendering of large distances. It is recommended to run this " ~
|
||||||
"configuration on relatively powerful hardware.");
|
"configuration on relatively powerful hardware.");
|
||||||
|
|
||||||
# Render Mode
|
# General
|
||||||
if (getprop("/sim/rendering/shaders/skydome")) {
|
if (getprop("/sim/rendering/shaders/skydome")) {
|
||||||
setprop("/sim/gui/dialogs/advanced/mode/low-spec-mode", 0);
|
setprop("/sim/gui/dialogs/advanced/mode/low-spec-mode", 0);
|
||||||
setprop("/sim/gui/dialogs/advanced/mode/als-mode", 1);
|
setprop("/sim/gui/dialogs/advanced/mode/als-mode", 1);
|
||||||
|
@ -1215,8 +1258,6 @@
|
||||||
setprop("/sim/gui/dialogs/advanced/mode/als-mode", 0);
|
setprop("/sim/gui/dialogs/advanced/mode/als-mode", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
# ALS Shader Settings
|
|
||||||
|
|
||||||
var landmass_val = getprop("/sim/rendering/shaders/landmass");
|
var landmass_val = getprop("/sim/rendering/shaders/landmass");
|
||||||
if (landmass_val <= 3) {
|
if (landmass_val <= 3) {
|
||||||
setprop("/sim/gui/dialogs/advanced/terrain-quality", "Low");
|
setprop("/sim/gui/dialogs/advanced/terrain-quality", "Low");
|
||||||
|
@ -1265,6 +1306,17 @@
|
||||||
setprop("/sim/gui/dialogs/advanced/overlay", "Enabled");
|
setprop("/sim/gui/dialogs/advanced/overlay", "Enabled");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var anti_aliasing_val = getprop("/sim/rendering/multi-samples");
|
||||||
|
if (anti_aliasing_val == 2) {
|
||||||
|
setprop("/sim/gui/dialogs/advanced/anti-aliasing", "MSAA 2x");
|
||||||
|
} else if (anti_aliasing_val == 4) {
|
||||||
|
setprop("/sim/gui/dialogs/advanced/anti-aliasing", "MSAA 4x");
|
||||||
|
} else if (anti_aliasing_val == 8) {
|
||||||
|
setprop("/sim/gui/dialogs/advanced/anti-aliasing", "MSAA 8x");
|
||||||
|
} else {
|
||||||
|
setprop("/sim/gui/dialogs/advanced/anti-aliasing", "Disabled");
|
||||||
|
}
|
||||||
|
|
||||||
# Shadows
|
# Shadows
|
||||||
if (getprop("/sim/rendering/shadows/enabled")) {
|
if (getprop("/sim/rendering/shadows/enabled")) {
|
||||||
var size = getprop("/sim/rendering/shadows/sun-atlas-size");
|
var size = getprop("/sim/rendering/shadows/sun-atlas-size");
|
||||||
|
|
Loading…
Add table
Reference in a new issue