1 #include "dialog_settings_effects.qh"
3 #include "slider_picmip.qh"
4 #include "slider_particles.qh"
5 #include "slider_sbfadetime.qh"
6 #include "weaponslist.qh"
7 #include "keybinder.qh"
8 #include "commandbutton.qh"
9 #include "textlabel.qh"
10 #include "checkbox.qh"
11 #include "textslider.qh"
13 #include "radiobutton.qh"
14 #include "checkbox_slider_invalid.qh"
16 entity makeXonoticEffectsSettingsTab()
19 me = NEW(XonoticEffectsSettingsTab);
20 me.configureDialog(me);
24 float someShadowCvarIsEnabled(entity box)
26 if(cvar("r_shadow_realtime_dlight"))
27 if(cvar("r_shadow_realtime_dlight_shadows"))
29 if(cvar("r_shadow_realtime_world"))
30 if(cvar("r_shadow_realtime_world_shadows"))
35 void XonoticEffectsSettingsTab_fill(entity me)
38 entity effectsApplyButton = makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "vid_restart", COMMANDBUTTON_APPLY);
39 effectsApplyButton.disableOnClick = true;
42 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Quality preset:")));
43 n = 5 + 2 * boolean(cvar("developer"));
46 me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^OMG!")), '1 0 1', "exec effects-omg.cfg", 0));
47 e.applyButton = effectsApplyButton;
49 me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Low")), '0 0 0', "exec effects-low.cfg", 0));
50 e.applyButton = effectsApplyButton;
51 me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Medium")), '0 0 0', "exec effects-med.cfg", 0));
52 e.applyButton = effectsApplyButton;
53 me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Normal")), '0 0 0', "exec effects-normal.cfg", 0));
54 e.applyButton = effectsApplyButton;
55 me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^High")), '0 0 0', "exec effects-high.cfg", 0));
56 e.applyButton = effectsApplyButton;
57 me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Ultra")), '0 0 0', "exec effects-ultra.cfg", 0));
58 e.applyButton = effectsApplyButton;
61 me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Ultimate")), '0.5 0 0', "exec effects-ultimate.cfg", 0));
62 e.applyButton = effectsApplyButton;
65 me.gotoRC(me, 1.25, 0);
66 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Geometry detail:")));
67 me.TD(me, 1, 2, e = makeXonoticTextSlider_T("r_subdivisions_tolerance",
68 _("Change the smoothness of the curves on the map (default: normal)")));
69 e.addValue(e, ZCTX(_("DET^Lowest")), "16");
70 e.addValue(e, ZCTX(_("DET^Low")), "8");
71 e.addValue(e, ZCTX(_("DET^Normal")), "4");
72 e.addValue(e, ZCTX(_("DET^Good")), "3");
73 e.addValue(e, ZCTX(_("DET^Best")), "2");
74 e.addValue(e, ZCTX(_("DET^Insane")), "1");
75 e.configureXonoticTextSliderValues(e);
76 e.applyButton = effectsApplyButton;
78 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Player detail:")));
79 me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_playerdetailreduction"));
80 e.addValue(e, ZCTX(_("PDET^Low")), "4");
81 e.addValue(e, ZCTX(_("PDET^Medium")), "3");
82 e.addValue(e, ZCTX(_("PDET^Normal")), "2");
83 e.addValue(e, ZCTX(_("PDET^Good")), "1");
84 e.addValue(e, ZCTX(_("PDET^Best")), "0");
85 e.configureXonoticTextSliderValues(e);
86 e.applyButton = effectsApplyButton;
88 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Texture resolution:")));
89 setDependent(e, "r_showsurfaces", 0, 0);
90 me.TD(me, 1, 2, e = makeXonoticPicmipSlider());
92 e.addValue(e, ZCTX(_("RES^Leet")), "1337");
93 e.addValue(e, ZCTX(_("RES^Lowest")), "3");
94 e.addValue(e, ZCTX(_("RES^Very low")), "2");
95 e.addValue(e, ZCTX(_("RES^Low")), "1");
96 e.addValue(e, ZCTX(_("RES^Normal")), "0");
97 e.addValue(e, ZCTX(_("RES^Good")), "-1");
98 e.addValue(e, ZCTX(_("RES^Best")), "-2");
99 e.configureXonoticTextSliderValues(e);
100 setDependent(e, "r_showsurfaces", 0, 0);
101 e.applyButton = effectsApplyButton;
105 // detect texture compression method
107 f = updateCompression();
111 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(1, "r_texture_dds_load", _("Avoid lossy texture compression")));
112 e.disabled = 1; // just show the checkbox anyway, but with no ability to control it
113 e.applyButton = effectsApplyButton;
116 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(1, "r_texture_dds_load", _("Avoid lossy texture compression")));
117 setDependent(e, "r_showsurfaces", 0, 0);
118 e.applyButton = effectsApplyButton;
121 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(1, "r_texture_dds_load", _("Avoid lossy texture compression")));
122 setDependent(e, "r_showsurfaces", 0, 0);
123 makeMulti(e, "gl_texturecompression");
124 e.applyButton = effectsApplyButton;
129 if(cvar("developer"))
132 me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx_T(3, 0, "r_showsurfaces", _("Show surfaces"),
133 _("Disable textures completely for very slow hardware. This gives a huge performance boost, but looks very ugly. (default: disabled)")));
136 me.TD(me, 1, 1, e = makeXonoticCheckBox_T(1, "mod_q3bsp_nolightmaps", _("Use lightmaps"),
137 _("Use high resolution lightmaps, which will look pretty but use up some extra video memory (default: enabled)")));
138 e.applyButton = effectsApplyButton;
139 me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "r_glsl_deluxemapping", _("Deluxe mapping"),
140 _("Use per-pixel lighting effects (default: enabled)")));
141 setDependentAND(e, "vid_gl20", 1, 1, "mod_q3bsp_nolightmaps", 0, 0);
142 me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "r_shadow_gloss", _("Gloss"),
143 _("Enable the use of glossmaps on textures supporting it (default: enabled)")));
144 setDependentAND3(e, "vid_gl20", 1, 1, "mod_q3bsp_nolightmaps", 0, 0, "r_glsl_deluxemapping", 1, 1);
146 me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "r_glsl_offsetmapping", _("Offset mapping"),
147 _("Offset mapping effect that will make textures with bumpmaps appear like they \"pop out\" of the flat 2D surface (default: disabled)")));
148 setDependent(e, "vid_gl20", 1, 1);
149 me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "r_glsl_offsetmapping_reliefmapping", _("Relief mapping"),
150 _("Higher quality offset mapping, which also has a huge impact on performance (default: disabled)")));
151 setDependentAND(e, "vid_gl20", 1, 1, "r_glsl_offsetmapping", 1, 1);
153 me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "r_water", _("Reflections:"),
154 _("Reflection and refraction quality, has a huge impact on performance on maps with reflecting surfaces (default: disabled)")));
155 setDependent(e, "vid_gl20", 1, 1);
156 me.TD(me, 1, 2, e = makeXonoticTextSlider_T("r_water_resolutionmultiplier",
157 _("Resolution of reflections/refractions (default: good)")));
158 e.addValue(e, _("Blurred"), "0.25");
159 e.addValue(e, ZCTX(_("REFL^Good")), "0.5");
160 e.addValue(e, _("Sharp"), "1");
161 e.configureXonoticTextSliderValues(e);
162 setDependentAND(e, "vid_gl20", 1, 1, "r_water", 1, 1);
164 me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "cl_decals", _("Decals"),
165 _("Enable decals (bullet holes and blood) (default: enabled)")));
166 me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "cl_decals_models", _("Decals on models")));
167 setDependent(e, "cl_decals", 1, 1);
170 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Distance:")));
171 setDependent(e, "cl_decals", 1, 1);
172 me.TD(me, 1, 2, e = makeXonoticSlider_T(200, 500, 20, "r_drawdecals_drawdistance",
173 _("Decals further away than this will not be drawn (default: 300)")));
174 setDependent(e, "cl_decals", 1, 1);
177 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Time:")));
178 setDependent(e, "cl_decals", 1, 1);
179 me.TD(me, 1, 2, e = makeXonoticSlider_T(1, 20, 1, "cl_decals_fadetime",
180 _("Time in seconds before decals fade away (default: 2)")));
181 setDependent(e, "cl_decals", 1, 1);
184 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Damage effects:")));
185 me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_damageeffect"));
186 e.addValue(e, ZCTX(_("DMGFX^Disabled")), "0");
187 e.addValue(e, _("Skeletal"), "1");
188 e.addValue(e, ZCTX(_("DMGFX^All")), "2");
189 e.configureXonoticTextSliderValues(e);
191 me.gotoRC(me, 1.25, 3.2); me.setFirstColumn(me, me.currentColumn);
192 me.TD(me, 1, 3, e = makeXonoticRadioButton_T(1, "r_coronas", "0", _("No dynamic lighting"),
193 _("Enable corona flares around certain lights (default: enabled)")));
195 me.TD(me, 1, 3, e = makeXonoticRadioButton_T(1, "gl_flashblend", string_null, _("Fake corona lighting"),
196 _("Enable faster but uglier dynamic lights by rendering bright coronas instead of real dynamic lights (default: disabled)")));
197 makeMulti(e, "r_coronas");
199 me.TD(me, 1, 2, e = makeXonoticRadioButton_T(1, "r_shadow_realtime_dlight", string_null, _("Realtime dynamic lighting"),
200 _("Enable rendering of dynamic lights such as explosions and rocket lights (default: enabled)")));
201 makeMulti(e, "r_coronas");
202 me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "r_shadow_realtime_dlight_shadows", _("Shadows"),
203 _("Enable rendering of shadows from dynamic lights (default: disabled)")));
204 setDependent(e, "r_shadow_realtime_dlight", 1, 1);
206 me.TD(me, 1, 2, e = makeXonoticCheckBox_T(0, "r_shadow_realtime_world", _("Realtime world lighting"),
207 _("Enable rendering of full realtime world lighting on maps that support it. Note that this might have a big impact on performance. (default: disabled)")));
208 me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "r_shadow_realtime_world_shadows", _("Shadows"),
209 _("Enable rendering of shadows from realtime world lights (default: disabled)")));
210 setDependent(e, "r_shadow_realtime_world", 1, 1);
213 me.TD(me, 1, 1.8, e = makeXonoticCheckBox_T(0, "r_shadow_usenormalmap", _("Use normal maps"),
214 _("Enable use of directional shading on textures (default: enabled)")));
215 setDependentOR(e, "r_shadow_realtime_dlight", 1, 1, "r_shadow_realtime_world", 1, 1);
216 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_shadow_shadowmapping", _("Soft shadows")));
217 setDependentWeird(e, someShadowCvarIsEnabled);
220 me.TD(me, 1, 2.8, e = makeXonoticCheckBox_T(0, "r_coronas_occlusionquery", _("Fade corona according to visibility"),
221 _("Fade coronas according to visibility (default: enabled)")));
222 setDependent(e, "r_coronas", 1, 1);
225 me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "r_bloom", _("Bloom"),
226 _("Enable bloom effect, which brightens the neighboring pixels of very bright pixels. Has a big impact on performance. (default: disabled)")));
227 me.TD(me, 1, 2, e = makeXonoticCheckBoxEx_T(0.5, 0, "hud_postprocessing_maxbluralpha", _("Extra postprocessing effects"),
228 _("Enables special postprocessing effects for when damaged or under water or using a powerup (default: disabled)")));
229 makeMulti(e, "hud_powerup");
230 setDependent(e, "vid_gl20", 1, 1);
232 s = makeXonoticSlider_T(0.1, 1, 0.1, "r_motionblur",
233 _("Motion blur strength - 0.4 recommended"));
234 me.TD(me, 1, 1, e = makeXonoticSliderCheckBox(0, 1, s, _("Motion blur:")));
235 if(s.value != e.savedValue)
236 e.savedValue = 0.4; // default
240 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "cl_particles", _("Particles")));
241 me.TD(me, 1, 2, e = makeXonoticCheckBox_T(0, "cl_spawn_point_particles", _("Spawnpoint effects"),
242 _("Particles effects at all spawn points and whenever a player spawns")));
243 makeMulti(e, "cl_spawn_event_particles");
244 setDependent(e, "cl_particles", 1, 1);
247 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Quality:")));
248 setDependent(e, "cl_particles", 1, 1);
249 me.TD(me, 1, 2, e = makeXonoticParticlesSlider());
250 setDependent(e, "cl_particles", 1, 1);
253 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Distance:")));
254 setDependent(e, "cl_particles", 1, 1);
255 me.TD(me, 1, 2, e = makeXonoticSlider_T(200, 500, 20, "r_drawparticles_drawdistance",
256 _("Particles further away than this will not be drawn (default: 1000)")));
257 setDependent(e, "cl_particles", 1, 1);
259 me.gotoRC(me, me.rows - 1, 0);
260 me.TD(me, 1, me.columns, effectsApplyButton);