Quality slider overwrites custom shader settings. All effects now listen to the new...
[fg:toms-fgdata.git] / gui / dialogs / rendering.xml
1 <?xml version="1.0"?>
2
3 <PropertyList>
4         <name>rendering</name>
5         <modal>false</modal>
6         <layout>vbox</layout>
7         <padding>20</padding>
8
9         <group>
10                 <layout>hbox</layout>
11                 <empty>
12                         <stretch>1</stretch>
13                 </empty>
14
15                 <text>
16                         <label>Rendering options</label>
17                 </text>
18
19                 <empty>
20                         <stretch>1</stretch>
21                 </empty>
22
23                 <button>
24                         <pref-width>16</pref-width>
25                         <pref-height>16</pref-height>
26                         <legend></legend>
27                         <keynum>27</keynum>
28                         <border>2</border>
29                         <binding>
30                                 <command>dialog-close</command>
31                         </binding>
32                 </button>
33         </group>
34
35         <hrule/>
36
37         <group>
38                 <halign>center</halign>
39                 <layout>hbox</layout>
40
41                 <group>
42                         <layout>vbox</layout>
43
44                         <group>
45                                 <layout>hbox</layout>
46                                 <text>
47                                         <label>General</label>
48                                         <halign>left</halign>
49                                 </text>
50                                 <hrule>
51                                         <stretch>true</stretch>
52                                 </hrule>
53                         </group>
54
55                         <checkbox>
56                                 <halign>left</halign>
57                                 <label>Wireframe</label>
58                                 <name>wireframe</name>
59                                 <property>/sim/rendering/wireframe</property>
60                                 <binding>
61                                         <command>dialog-apply</command>
62                                         <object-name>wireframe</object-name>
63                                 </binding>
64                         </checkbox>
65
66                         <!--
67                         <group>
68                                 <layout>hbox</layout>
69                                 <text>
70                                 <label>Lighting</label>
71                                 <halign>left</halign>
72                                 </text>
73                                 <hrule>
74                                 <stretch>true</stretch>
75                                 </hrule>
76                         </group>
77
78                         <checkbox>
79                                 <halign>left</halign>
80                                 <label>Sun/Moon horizon effect</label>
81                                 <property>/sim/rendering/horizon-effect</property>
82                                 <binding>
83                                         <command>dialog-apply</command>
84                                 </binding>
85                         </checkbox>
86                         -->
87
88                         <checkbox>
89                                 <halign>left</halign>
90                                 <label>Use point sprites for runway lights (requires restart)</label>
91                                 <property>/sim/rendering/point-sprites</property>
92                                 <binding>
93                                         <command>dialog-apply</command>
94                                 </binding>
95                         </checkbox>
96
97                         <!--
98                         <checkbox>
99                                 <halign>left</halign>
100                                 <label>Enhanced runway lighting</label>
101                                 <property>/sim/rendering/enhanced-lighting</property>
102                                 <binding>
103                                         <command>dialog-apply</command>
104                                 </binding>
105                         </checkbox>
106
107                         <checkbox>
108                                 <halign>left</halign>
109                                 <label>Runway light distance attenuation</label>
110                                 <property>/sim/rendering/distance-attenuation</property>
111                                 <binding>
112                                         <command>dialog-apply</command>
113                                 </binding>
114                         </checkbox>
115
116                         <checkbox>
117                                 <halign>left</halign>
118                                 <label>Specular reflections on objects</label>
119                                 <property>/sim/rendering/specular-highlight</property>
120                                 <binding>
121                                         <command>dialog-apply</command>
122                                 </binding>
123                         </checkbox>
124                         -->
125
126                         <group>
127                                 <layout>hbox</layout>
128                                 <text>
129                                         <label>Objects</label>
130                                         <halign>left</halign>
131                                 </text>
132                                 <hrule>
133                                         <stretch>true</stretch>
134                                 </hrule>
135                         </group>
136
137                         <checkbox>
138                                 <halign>left</halign>
139                                 <label>Particles (smoke, dust, spray)</label>
140                                 <name>particles</name>
141                                 <property>/sim/rendering/particles</property>
142                                 <binding>
143                                         <command>dialog-apply</command>
144                                         <object-name>particles</object-name>
145                                 </binding>
146                         </checkbox>
147
148                         <checkbox>
149                                 <halign>left</halign>
150                                 <label>Precipitation</label>
151                                 <name>precipitation</name>
152                                 <property>/sim/rendering/precipitation-gui-enable</property>
153                                 <binding>
154                                         <command>dialog-apply</command>
155                                         <object-name>precipitation</object-name>
156                                 </binding>
157                         </checkbox>
158
159                         <!--
160
161                         <checkbox>
162                                 <halign>left</halign>
163                                 <label>Lightning</label>
164                                 <property>/sim/rendering/lightning-enable</property>
165                                 <binding>
166                                         <command>dialog-apply</command>
167                                 </binding>
168                         </checkbox>
169
170                         -->
171
172                         <checkbox>
173                                 <halign>left</halign>
174                                 <label>Random objects</label>
175                                 <name>random-objects</name>
176                                 <property>/sim/rendering/random-objects</property>
177                                 <binding>
178                                         <command>dialog-apply</command>
179                                         <object-name>random-objects</object-name>
180                                 </binding>
181                                 <binding>
182                                         <command>reinit</command>
183                                         <subsystem>tile-manager</subsystem>
184                                 </binding>
185                         </checkbox>
186
187                         <checkbox>
188                                 <halign>left</halign>
189                                 <label>Random vegetation</label>
190                                 <name>random-vegetation</name>
191                                 <property>/sim/rendering/random-vegetation</property>
192                                 <binding>
193                                         <command>dialog-apply</command>
194                                         <object-name>random-vegetation</object-name>
195                                 </binding>
196                                 <binding>
197                                         <command>reinit</command>
198                                         <subsystem>tile-manager</subsystem>
199                                 </binding>
200                         </checkbox>
201
202                         <checkbox>
203                                 <halign>left</halign>
204                                 <label>Animated jetways</label>
205                                 <name>jetways</name>
206                                 <property>/nasal/jetways/enabled</property>
207                                 <binding>
208                                         <command>dialog-apply</command>
209                                         <object-name>jetways</object-name>
210                                 </binding>
211                         </checkbox>
212
213                         <group>
214                                 <layout>hbox</layout>
215                                 <text>
216                                         <label>Clouds</label>
217                                         <halign>left</halign>
218                                 </text>
219                                 <hrule>
220                                         <stretch>true</stretch>
221                                 </hrule>
222                         </group>
223
224                         <!--
225
226                         <checkbox>
227                                 <halign>left</halign>
228                                 <label>2D clouds</label>
229                                 <property>/sim/rendering/bump-mapping</property>
230                                 <binding>
231                                         <command>dialog-apply</command>
232                                 </binding>
233                         </checkbox>
234
235                         -->
236
237                         <checkbox>
238                                 <halign>left</halign>
239                                 <label>3D clouds</label>
240                                 <name>3d-clouds</name>
241                                 <property>/sim/rendering/clouds3d-enable</property>
242                                 <binding>
243                                         <command>dialog-apply</command>
244                                         <object-name>3d-clouds</object-name>
245                                 </binding>
246                         </checkbox>
247
248                         <group>
249                                 <layout>hbox</layout>
250                                 <halign>right</halign>
251                                 <text>
252                                         <label>Cloud density</label>
253                                         <enable>
254                                                 <property>/sim/rendering/clouds3d-enable</property>
255                                         </enable>
256                                 </text>
257                                 <slider>
258                                         <name>cloud-density</name>
259                                         <enable>
260                                                 <property>/sim/rendering/clouds3d-enable</property>
261                                         </enable>
262                                         <min>0</min>
263                                         <max>1.0</max>
264                                         <property>/sim/rendering/clouds3d-density</property>
265                                         <binding>
266                                                 <command>dialog-apply</command>
267                                                 <object-name>cloud-density</object-name>
268                                         </binding>
269                                         <binding>
270                                                 <command>property-toggle</command>
271                                                 <property>/sim/rendering/clouds3d-enable</property>
272                                         </binding>
273                                         <binding>
274                                                 <command>property-toggle</command>
275                                                 <property>/sim/rendering/clouds3d-enable</property>
276                                         </binding>
277                                 </slider>
278                                 <text>
279                                         <enable>
280                                                 <property>/sim/rendering/clouds3d-enable</property>
281                                         </enable>
282                                         <label>12345678</label>
283                                         <format>%.2f</format>
284                                         <live>true</live>
285                                         <property>/sim/rendering/clouds3d-density</property>
286                                 </text>
287                         </group>
288
289                         <group>
290                                 <layout>hbox</layout>
291                                 <halign>right</halign>
292                                 <text>
293                                         <label>Cloud visibility range</label>
294                                         <enable>
295                                                 <property>/sim/rendering/clouds3d-enable</property>
296                                         </enable>
297                                 </text>
298                                 <slider>
299                                         <name>cloud-vis-range</name>
300                                         <enable>
301                                                 <property>/sim/rendering/clouds3d-enable</property>
302                                         </enable>
303                                         <min>1000.0</min>
304                                         <max>45000.0</max>
305                                         <property>/sim/rendering/clouds3d-vis-range</property>
306                                         <binding>
307                                                 <command>dialog-apply</command>
308                                                 <object-name>cloud-vis-range</object-name>
309                                         </binding>
310                                 </slider>
311                                 <text>
312                                         <enable>
313                                                 <property>/sim/rendering/clouds3d-enable</property>
314                                         </enable>
315                                         <label>12345678</label>
316                                         <format>%.fm</format>
317                                         <live>true</live>
318                                         <property>/sim/rendering/clouds3d-vis-range</property>
319                                 </text>
320                         </group>
321
322                         <group>
323                                 <layout>vbox</layout>
324                                 <stretch>1</stretch>
325                         </group>
326
327                 </group>
328
329                 <vrule/>
330
331                 <group>
332                         <layout>vbox</layout>
333
334                         <group>
335                                 <layout>hbox</layout>
336                                 <text>
337                                         <label>Shader effects</label>
338                                         <halign>left</halign>
339                                 </text>
340                                 <hrule>
341                                         <stretch>true</stretch>
342                                 </hrule>
343                         </group>
344                         
345                         <group>
346                                 <layout>vbox</layout>
347                                 <padding>4</padding>
348                                 <text>
349                                         <padding>0</padding>
350                                         <label>This slider overrides custom settings as set in</label>
351                                         <halign>left</halign>
352                                 </text>
353                                 <text>
354                                         <padding>0</padding>
355                                         <label>the (advanced) Shader Options dialog.</label>
356                                         <halign>left</halign>
357                                 </text>
358                         </group>
359                         
360                         <group>
361                                 <layout>hbox</layout>
362
363                                 <text>
364                                         <label>Performance</label>
365                                 </text>
366                                 <slider>
367                                         <name>quality-level</name>
368                                         <min>0.0</min>
369                                         <max>5.0</max>
370                                         <step>1.0</step>
371                                         <fraction>0.17</fraction>
372                                         <property>/sim/rendering/shaders/quality-level</property>
373                                         <binding>
374                                                 <command>dialog-apply</command>
375                                                 <object-name>quality-level</object-name>
376                                         </binding>
377                                 </slider>
378                                 <text>
379                                         <label>Quality</label>
380                                 </text>
381                                 <text>
382                                         <label>12345678</label>
383                                         <format>(%1.0f)</format>
384                                         <live>true</live>
385                                         <property>/sim/rendering/shaders/quality-level</property>
386                                 </text>
387                         </group>
388
389                         <group>
390                                 <layout>hbox</layout>
391                                 <button>
392                                         <legend>Shader Options</legend>
393                                         <binding>
394                                                 <command>dialog-show</command>
395                                                 <dialog-name>shaders</dialog-name>
396                                         </binding>
397                                 </button>
398
399                                 <group>
400                                         <layout>vbox</layout>
401                                         <text>
402                                                 <visible>
403                                                         <not>
404                                                                 <property>/sim/rendering/shaders/quality-level</property>
405                                                         </not>
406                                                 </visible>
407                                                 <label>Adjust the slider </label>
408                                                 <halign>left</halign>
409                                                 <color>
410                                                         <red>1.0</red>
411                                                         <green>0.6</green>
412                                                         <blue>0.6</blue>
413                                                 </color>
414                                         </text>
415                                         <text>
416                                                 <visible>
417                                                         <not>
418                                                                 <property>/sim/rendering/shaders/quality-level</property>
419                                                         </not>
420                                                 </visible>
421                                                 <label>to enable shaders.</label>
422                                                 <halign>left</halign>
423                                                 <color>
424                                                         <red>1.0</red>
425                                                         <green>0.6</green>
426                                                         <blue>0.6</blue>
427                                                 </color>
428                                         </text>
429                                 </group>
430                         </group>
431
432                         <group>
433                                 <layout>hbox</layout>
434                                 <text>
435                                         <enable>
436                                                 <property>/sim/rendering/shaders/quality-level</property>
437                                         </enable>
438                                         <label>Experimental effects</label>
439                                         <halign>left</halign>
440                                         <color>
441                                                 <red>1.0</red>
442                                                 <green>0.6</green>
443                                                 <blue>0.6</blue>
444                                         </color>
445                                 </text>
446                                 <hrule>
447                                         <stretch>true</stretch>
448                                 </hrule>
449                         </group>
450
451                         <group>
452                                 <layout>vbox</layout>
453                                 <checkbox>
454                                         <halign>left</halign>
455                                         <enable>
456                                                 <property>/sim/rendering/shaders/quality-level</property>
457                                         </enable>
458                                         <label>Skydome scattering</label>
459                                         <name>skydome-scattering</name>
460                                         <property>/sim/rendering/shaders/skydome</property>
461                                         <binding>
462                                                 <command>dialog-apply</command>
463                                                 <object-name>skydome-scattering</object-name>
464                                         </binding>
465                                 </checkbox>
466                         </group>
467
468                         <group>
469                                 <layout>hbox</layout>
470                                 <halign>right</halign>
471                                 <text>
472                                         <label>Mie factor</label>
473                                         <enable>
474                                                 <and>
475                                                         <property>/sim/rendering/shaders/quality-level</property>
476                                                         <property>/sim/rendering/shaders/skydome</property>
477                                                 </and>
478                                         </enable>
479                                 </text>
480                                 <slider>
481                                         <name>mie-factor</name>
482                                         <enable>
483                                                 <and>
484                                                         <property>/sim/rendering/shaders/quality-level</property>
485                                                         <property>/sim/rendering/shaders/skydome</property>
486                                                 </and>
487                                         </enable>
488                                         <min>0.0</min>
489                                         <max>0.01</max>
490                                         <step>0.001</step>
491                                         <property>/sim/rendering/mie</property>
492                                         <binding>
493                                                 <command>dialog-apply</command>
494                                                 <object-name>mie-factor</object-name>
495                                         </binding>
496                                 </slider>
497                                 <text>
498                                         <enable>
499                                                 <and>
500                                                         <property>/sim/rendering/shaders/quality-level</property>
501                                                         <property>/sim/rendering/shaders/skydome</property>
502                                                 </and>
503                                         </enable>
504                                         <label>12345678</label>
505                                         <format>%.3f</format>
506                                         <live>true</live>
507                                         <property>/sim/rendering/mie</property>
508                                 </text>
509                         </group>
510
511                         <group>
512                                 <layout>hbox</layout>
513                                 <halign>right</halign>
514                                 <text>
515                                         <label>Rayleigh factor</label>
516                                         <enable>
517                                                 <and>
518                                                         <property>/sim/rendering/shaders/quality-level</property>
519                                                         <property>/sim/rendering/shaders/skydome</property>
520                                                 </and>
521                                         </enable>
522                                 </text>
523                                 <slider>
524                                         <name>rayleigh-factor</name>
525                                         <enable>
526                                                 <and>
527                                                         <property>/sim/rendering/shaders/quality-level</property>
528                                                         <property>/sim/rendering/shaders/skydome</property>
529                                                 </and>
530                                         </enable>
531                                         <min>0.0</min>
532                                         <max>0.001</max>
533                                         <step>0.0001</step>
534                                         <property>/sim/rendering/rayleigh</property>
535                                         <binding>
536                                                 <command>dialog-apply</command>
537                                                 <object-name>rayleigh-factor</object-name>
538                                         </binding>
539                                 </slider>
540                                 <text>
541                                         <enable>
542                                                 <and>
543                                                         <property>/sim/rendering/shaders/quality-level</property>
544                                                         <property>/sim/rendering/shaders/skydome</property>
545                                                 </and>
546                                         </enable>
547                                         <label>12345678</label>
548                                         <format>%.4f</format>
549                                         <live>true</live>
550                                         <property>/sim/rendering/rayleigh</property>
551                                 </text>
552                         </group>
553
554                         <group>
555                                 <layout>hbox</layout>
556                                 <halign>right</halign>
557                                 <text>
558                                         <label>Density factor</label>
559                                         <enable>
560                                                 <and>
561                                                         <property>/sim/rendering/shaders/quality-level</property>
562                                                         <property>/sim/rendering/shaders/skydome</property>
563                                                 </and>
564                                         </enable>
565                                 </text>
566                                 <slider>
567                                         <name>density-factor</name>
568                                         <enable>
569                                                 <and>
570                                                         <property>/sim/rendering/shaders/quality-level</property>
571                                                         <property>/sim/rendering/shaders/skydome</property>
572                                                 </and>
573                                         </enable>
574                                         <min>0.0</min>
575                                         <max>1.0</max>
576                                         <step>0.1</step>
577                                         <property>/sim/rendering/dome-density</property>
578                                         <binding>
579                                                 <command>dialog-apply</command>
580                                                 <object-name>density-factor</object-name>
581                                         </binding>
582                                 </slider>
583                                 <text>
584                                         <enable>
585                                                 <and>
586                                                         <property>/sim/rendering/shaders/quality-level</property>
587                                                         <property>/sim/rendering/shaders/skydome</property>
588                                                 </and>
589                                         </enable>
590                                         <label>12345678</label>
591                                         <format>%.1f</format>
592                                         <live>true</live>
593                                         <property>/sim/rendering/dome-density</property>
594                                 </text>
595                         </group>
596
597                         <empty>
598                                 <stretch>1</stretch>
599                         </empty>
600
601                 </group>
602         </group>
603
604         <hrule/>
605
606         <button>
607                 <legend>Close</legend>
608                 <default>true</default>
609                 <key>Esc</key>
610                 <binding>
611                         <command>dialog-close</command>
612                 </binding>
613         </button>
614
615         <nasal>
616                 <open>
617                         gui.enable_widgets(cmdarg(), "shadows-debug", getprop("/sim/gui/devel-widgets"));
618                         
619                         # overwrite custom shader settings on quality-slider input
620                         _setlistener("/sim/rendering/shaders/quality-level", func {
621                                 var qualityLevel = getprop("/sim/rendering/shaders/quality-level");
622                                 setprop("/sim/rendering/shaders/landmass",qualityLevel);
623                                 setprop("/sim/rendering/shaders/urban",qualityLevel);
624                                 setprop("/sim/rendering/shaders/water",qualityLevel);
625                                 if (qualityLevel >= 1.0){
626                                         qualityLevel = 1.0;
627                                 }
628                                 else {
629                                         qualityLevel = 0.0;
630                                 }
631                                 setprop("/sim/rendering/shaders/contrails",qualityLevel);
632                                 setprop("/sim/rendering/shaders/crop",qualityLevel);
633                                 setprop("/sim/rendering/shaders/generic",qualityLevel);
634                                 setprop("/sim/rendering/shaders/model",qualityLevel);
635                                 setprop("/sim/rendering/shaders/transition",qualityLevel);
636                         });
637                 </open>
638         </nasal>
639 </PropertyList>