2 CLASS(XonoticEffectsSettingsTab) EXTENDS(XonoticTab)
3 METHOD(XonoticEffectsSettingsTab, fill, void(entity))
4 ATTRIB(XonoticEffectsSettingsTab, title, string, _("Effects"))
5 ATTRIB(XonoticEffectsSettingsTab, intendedWidth, float, 0.9)
6 ATTRIB(XonoticEffectsSettingsTab, rows, float, 17)
7 ATTRIB(XonoticEffectsSettingsTab, columns, float, 6.5)
8 ENDCLASS(XonoticEffectsSettingsTab)
9 entity makeXonoticEffectsSettingsTab();
10 float updateCompression();
14 entity makeXonoticEffectsSettingsTab()
17 me = spawnXonoticEffectsSettingsTab();
18 me.configureDialog(me);
22 float someShadowCvarIsEnabled(entity box)
24 if(cvar("r_shadow_realtime_dlight"))
25 if(cvar("r_shadow_realtime_dlight_shadows"))
27 if(cvar("r_shadow_realtime_world"))
28 if(cvar("r_shadow_realtime_world_shadows"))
33 void XonoticEffectsSettingsTab_fill(entity me)
38 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Quality preset:")));
39 n = 5 + 2 * !!cvar("developer");
41 me.TD(me, 1, 5.5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^OMG!")), '1 0 1', "exec effects-omg.cfg", 0));
42 me.TD(me, 1, 5.5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Low")), '0 0 0', "exec effects-low.cfg", 0));
43 me.TD(me, 1, 5.5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Medium")), '0 0 0', "exec effects-med.cfg", 0));
44 me.TD(me, 1, 5.5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Normal")), '0 0 0', "exec effects-normal.cfg", 0));
45 me.TD(me, 1, 5.5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^High")), '0 0 0', "exec effects-high.cfg", 0));
46 me.TD(me, 1, 5.5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Ultra")), '0 0 0', "exec effects-ultra.cfg", 0));
48 me.TD(me, 1, 5.5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Ultimate")), '0 0 0', "exec effects-ultimate.cfg", 0));
52 me.TD(me, 1, 1.1, e = makeXonoticTextLabel(0, _("Geometry detail:")));
53 me.TD(me, 1, 2, e = makeXonoticTextSlider("r_subdivisions_tolerance"));
54 e.addValue(e, ZCTX(_("DET^Lowest")), "16");
55 e.addValue(e, ZCTX(_("DET^Low")), "8");
56 e.addValue(e, ZCTX(_("DET^Normal")), "4");
57 e.addValue(e, ZCTX(_("DET^Good")), "3");
58 e.addValue(e, ZCTX(_("DET^Best")), "2");
59 e.addValue(e, ZCTX(_("DET^Insane")), "1");
60 e.configureXonoticTextSliderValues(e);
62 me.TD(me, 1, 1.1, e = makeXonoticTextLabel(0, _("Antialiasing:")));
63 me.TD(me, 1, 2, e = makeXonoticTextSlider("vid_samples"));
64 e.addValue(e, ZCTX(_("AA^Disabled")), "1");
65 e.addValue(e, _("2x"), "2");
66 e.addValue(e, _("4x"), "4");
67 e.configureXonoticTextSliderValues(e);
70 me.TD(me, 1, 1.1, e = makeXonoticTextLabel(0, _("Texture resolution:")));
71 me.TD(me, 1, 2, e = makeXonoticPicmipSlider());
73 e.addValue(e, ZCTX(_("RES^Leet")), "1337");
74 e.addValue(e, ZCTX(_("RES^Lowest")), "2");
75 e.addValue(e, ZCTX(_("RES^Low")), "1");
76 e.addValue(e, ZCTX(_("RES^Normal")), "0");
77 e.addValue(e, ZCTX(_("RES^Good")), "-1");
78 e.addValue(e, ZCTX(_("RES^Best")), "-2");
79 e.configureXonoticTextSliderValues(e);
83 // detect texture compression method
85 f = updateCompression();
91 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(1, "r_texture_dds_load", _("Avoid lossy texture compression")));
94 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(1, "r_texture_dds_load", _("Avoid lossy texture compression")));
95 makeMulti(e, "gl_texturecompression");
100 me.TD(me, 1, 1.1, e = makeXonoticTextLabel(0, _("Anisotropy:")));
101 me.TD(me, 1, 2, e = makeXonoticTextSlider("gl_texture_anisotropy"));
102 e.addValue(e, ZCTX(_("ANISO^Disabled")), "1");
103 e.addValue(e, _("2x"), "2");
104 e.addValue(e, _("4x"), "4");
105 e.addValue(e, _("8x"), "8");
106 e.addValue(e, _("16x"), "16");
107 e.configureXonoticTextSliderValues(e);
110 me.TD(me, 1, 1.1, e = makeXonoticTextLabel(0, _("Particle quality:")));
111 me.TD(me, 1, 1.9, e = makeXonoticSlider(0.2, 1.0, 0.1, "cl_particles_quality"));
113 me.TD(me, 1, 1.1, e = makeXonoticTextLabel(0, _("Particle distance:")));
114 me.TD(me, 1, 1.9, e = makeXonoticSlider(500, 2000, 100, "r_drawparticles_drawdistance"));
117 me.TD(me, 1, 1.5, e = makeXonoticCheckBox(0, "cl_decals", _("Decals")));
118 me.TD(me, 1, 1.5, e = makeXonoticCheckBox(0, "cl_decals_models", _("Decals on models")));
119 setDependent(e, "cl_decals", 1, 1);
122 me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Distance:")));
123 setDependent(e, "cl_decals", 1, 1);
124 me.TD(me, 1, 1.9, e = makeXonoticSlider(200, 500, 20, "r_drawdecals_drawdistance"));
125 setDependent(e, "cl_decals", 1, 1);
128 me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Time:")));
129 setDependent(e, "cl_decals", 1, 1);
130 me.TD(me, 1, 1.9, e = makeXonoticSlider(1, 20, 1, "cl_decals_time"));
131 setDependent(e, "cl_decals", 1, 1);
133 me.gotoRC(me, 2, 3.5); me.setFirstColumn(me, me.currentColumn);
134 me.TD(me, 1, 1.2, e = makeXonoticCheckBox(1, "mod_q3bsp_nolightmaps", _("Use lightmaps")));
135 me.TD(me, 1, 1.2, e = makeXonoticCheckBox(0, "r_glsl_deluxemapping", _("Deluxe mapping")));
136 setDependentAND(e, "vid_gl20", 1, 1, "mod_q3bsp_nolightmaps", 0, 0);
137 me.TD(me, 1, 0.6, e = makeXonoticCheckBox(0, "r_shadow_gloss", _("Gloss"))); // FIXME move this box elsewhere, it has nothing to do with Q3BSP lightmaps
138 setDependent(e, "vid_gl20", 1, 1);
140 me.TD(me, 1, 1.2, e = makeXonoticCheckBox(0, "r_glsl_offsetmapping", _("Offset mapping")));
141 setDependent(e, "vid_gl20", 1, 1);
142 me.TD(me, 1, 1.8, e = makeXonoticCheckBox(0, "r_glsl_offsetmapping_reliefmapping", _("Relief mapping")));
143 setDependentAND(e, "vid_gl20", 1, 1, "r_glsl_offsetmapping", 1, 1);
145 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_water", _("Reflections:")));
146 setDependent(e, "vid_gl20", 1, 1);
147 me.TD(me, 1, 2, e = makeXonoticTextSlider("r_water_resolutionmultiplier"));
148 e.addValue(e, _("Blurred"), "0.25");
149 e.addValue(e, ZCTX(_("REFL^Good")), "0.5");
150 e.addValue(e, _("Sharp"), "1");
151 e.configureXonoticTextSliderValues(e);
152 setDependentAND(e, "vid_gl20", 1, 1, "r_water", 1, 1);
154 if(cvar("developer"))
155 me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(3, 0, "r_showsurfaces", _("Show surfaces")));
157 me.TD(me, 1, 3, e = makeXonoticRadioButton(1, string_null, string_null, _("No dynamic lighting")));
159 me.TD(me, 1, 3, e = makeXonoticRadioButton(1, "gl_flashblend", string_null, _("Flash blend approximation")));
161 me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "r_shadow_realtime_dlight", string_null, _("Realtime dynamic lighting")));
162 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_shadow_realtime_dlight_shadows", _("Shadows")));
163 setDependent(e, "r_shadow_realtime_dlight", 1, 1);
165 me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "r_shadow_realtime_world", _("Realtime world lighting")));
166 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_shadow_realtime_world_shadows", _("Shadows")));
167 setDependent(e, "r_shadow_realtime_world", 1, 1);
170 me.TD(me, 1, 1.8, e = makeXonoticCheckBox(0, "r_shadow_usenormalmap", _("Use normal maps")));
171 setDependentOR(e, "r_shadow_realtime_dlight", 1, 1, "r_shadow_realtime_world", 1, 1);
172 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_shadow_shadowmapping", _("Soft shadows")));
173 setDependentWeird(e, someShadowCvarIsEnabled);
175 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_coronas", _("Coronas")));
176 me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "r_coronas_occlusionquery", _("Use Occlusion Queries")));
178 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "r_bloom", _("High Dynamic Range (HDR)")));
181 s = makeXonoticSlider(0.1, 1, 0.1, "r_motionblur");
182 me.TD(me, 1, 1, e = makeXonoticSliderCheckBox(0, 1, s, _("Motion blur:")));
183 if(s.value != e.savedValue)
184 e.savedValue = 0.5; // default
187 e = makeXonoticCheckBoxEx(0.5, 0, "hud_postprocessing_maxbluralpha", _("Blur and sharpen postprocessing"));
188 makeMulti(e, "hud_powerup");
191 me.gotoRC(me, me.rows - 1, 0);
192 me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "vid_restart", COMMANDBUTTON_APPLY));