1 #include "dialog_settings_effects.qh"
2 #ifndef DIALOG_SETTINGS_EFFECTS_H
3 #define DIALOG_SETTINGS_EFFECTS_H
5 CLASS(XonoticEffectsSettingsTab, XonoticTab)
6 METHOD(XonoticEffectsSettingsTab, fill, void(entity));
7 ATTRIB(XonoticEffectsSettingsTab, intendedWidth, float, 0.9)
8 ATTRIB(XonoticEffectsSettingsTab, rows, float, 15.5)
9 ATTRIB(XonoticEffectsSettingsTab, columns, float, 6.2) // added extra .2 for center space
10 ENDCLASS(XonoticEffectsSettingsTab)
11 entity makeXonoticEffectsSettingsTab();
15 entity makeXonoticEffectsSettingsTab()
18 me = NEW(XonoticEffectsSettingsTab);
19 me.configureDialog(me);
23 float someShadowCvarIsEnabled(entity box)
25 if(cvar("r_shadow_realtime_dlight"))
26 if(cvar("r_shadow_realtime_dlight_shadows"))
28 if(cvar("r_shadow_realtime_world"))
29 if(cvar("r_shadow_realtime_world_shadows"))
34 void XonoticEffectsSettingsTab_fill(entity me)
37 entity effectsApplyButton = makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "vid_restart", COMMANDBUTTON_APPLY);
38 effectsApplyButton.disableOnClick = true;
41 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Quality preset:")));
42 n = 5 + 2 * boolean(cvar("developer"));
45 me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^OMG!")), '1 0 1', "exec effects-omg.cfg", 0));
46 e.applyButton = effectsApplyButton;
48 me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Low")), '0 0 0', "exec effects-low.cfg", 0));
49 e.applyButton = effectsApplyButton;
50 me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Medium")), '0 0 0', "exec effects-med.cfg", 0));
51 e.applyButton = effectsApplyButton;
52 me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Normal")), '0 0 0', "exec effects-normal.cfg", 0));
53 e.applyButton = effectsApplyButton;
54 me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^High")), '0 0 0', "exec effects-high.cfg", 0));
55 e.applyButton = effectsApplyButton;
56 me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Ultra")), '0 0 0', "exec effects-ultra.cfg", 0));
57 e.applyButton = effectsApplyButton;
60 me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Ultimate")), '0.5 0 0', "exec effects-ultimate.cfg", 0));
61 e.applyButton = effectsApplyButton;
64 me.gotoRC(me, 1.25, 0);
65 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Geometry detail:")));
66 me.TD(me, 1, 2, e = makeXonoticTextSlider_T("r_subdivisions_tolerance",
67 _("Change the smoothness of the curves on the map (default: normal)")));
68 e.addValue(e, ZCTX(_("DET^Lowest")), "16");
69 e.addValue(e, ZCTX(_("DET^Low")), "8");
70 e.addValue(e, ZCTX(_("DET^Normal")), "4");
71 e.addValue(e, ZCTX(_("DET^Good")), "3");
72 e.addValue(e, ZCTX(_("DET^Best")), "2");
73 e.addValue(e, ZCTX(_("DET^Insane")), "1");
74 e.configureXonoticTextSliderValues(e);
75 e.applyButton = effectsApplyButton;
77 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Player detail:")));
78 me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_playerdetailreduction"));
79 e.addValue(e, ZCTX(_("PDET^Low")), "4");
80 e.addValue(e, ZCTX(_("PDET^Medium")), "3");
81 e.addValue(e, ZCTX(_("PDET^Normal")), "2");
82 e.addValue(e, ZCTX(_("PDET^Good")), "1");
83 e.addValue(e, ZCTX(_("PDET^Best")), "0");
84 e.configureXonoticTextSliderValues(e);
85 e.applyButton = effectsApplyButton;
87 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Texture resolution:")));
88 setDependent(e, "r_showsurfaces", 0, 0);
89 me.TD(me, 1, 2, e = makeXonoticPicmipSlider());
91 e.addValue(e, ZCTX(_("RES^Leet")), "1337");
92 e.addValue(e, ZCTX(_("RES^Lowest")), "3");
93 e.addValue(e, ZCTX(_("RES^Very low")), "2");
94 e.addValue(e, ZCTX(_("RES^Low")), "1");
95 e.addValue(e, ZCTX(_("RES^Normal")), "0");
96 e.addValue(e, ZCTX(_("RES^Good")), "-1");
97 e.addValue(e, ZCTX(_("RES^Best")), "-2");
98 e.configureXonoticTextSliderValues(e);
99 setDependent(e, "r_showsurfaces", 0, 0);
100 e.applyButton = effectsApplyButton;
104 // detect texture compression method
106 f = updateCompression();
110 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(1, "r_texture_dds_load", _("Avoid lossy texture compression")));
111 e.disabled = 1; // just show the checkbox anyway, but with no ability to control it
112 e.applyButton = effectsApplyButton;
115 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(1, "r_texture_dds_load", _("Avoid lossy texture compression")));
116 setDependent(e, "r_showsurfaces", 0, 0);
117 e.applyButton = effectsApplyButton;
120 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(1, "r_texture_dds_load", _("Avoid lossy texture compression")));
121 setDependent(e, "r_showsurfaces", 0, 0);
122 makeMulti(e, "gl_texturecompression");
123 e.applyButton = effectsApplyButton;
128 if(cvar("developer"))
131 me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx_T(3, 0, "r_showsurfaces", _("Show surfaces"),
132 _("Disable textures completely for very slow hardware. This gives a huge performance boost, but looks very ugly. (default: disabled)")));
135 me.TD(me, 1, 1, e = makeXonoticCheckBox_T(1, "mod_q3bsp_nolightmaps", _("Use lightmaps"),
136 _("Use high resolution lightmaps, which will look pretty but use up some extra video memory (default: enabled)")));
137 me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "r_glsl_deluxemapping", _("Deluxe mapping"),
138 _("Use per-pixel lighting effects (default: enabled)")));
139 setDependentAND(e, "vid_gl20", 1, 1, "mod_q3bsp_nolightmaps", 0, 0);
140 me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "r_shadow_gloss", _("Gloss"),
141 _("Enable the use of glossmaps on textures supporting it (default: enabled)")));
142 setDependentAND3(e, "vid_gl20", 1, 1, "mod_q3bsp_nolightmaps", 0, 0, "r_glsl_deluxemapping", 1, 1);
144 me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "r_glsl_offsetmapping", _("Offset mapping"),
145 _("Offset mapping effect that will make textures with bumpmaps appear like they \"pop out\" of the flat 2D surface (default: disabled)")));
146 setDependent(e, "vid_gl20", 1, 1);
147 me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "r_glsl_offsetmapping_reliefmapping", _("Relief mapping"),
148 _("Higher quality offset mapping, which also has a huge impact on performance (default: disabled)")));
149 setDependentAND(e, "vid_gl20", 1, 1, "r_glsl_offsetmapping", 1, 1);
151 me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "r_water", _("Reflections:"),
152 _("Reflection and refraction quality, has a huge impact on performance on maps with reflecting surfaces (default: disabled)")));
153 setDependent(e, "vid_gl20", 1, 1);
154 me.TD(me, 1, 2, e = makeXonoticTextSlider_T("r_water_resolutionmultiplier",
155 _("Resolution of reflections/refractions (default: good)")));
156 e.addValue(e, _("Blurred"), "0.25");
157 e.addValue(e, ZCTX(_("REFL^Good")), "0.5");
158 e.addValue(e, _("Sharp"), "1");
159 e.configureXonoticTextSliderValues(e);
160 setDependentAND(e, "vid_gl20", 1, 1, "r_water", 1, 1);
162 me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "cl_decals", _("Decals"),
163 _("Enable decals (bullet holes and blood) (default: enabled)")));
164 me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "cl_decals_models", _("Decals on models")));
165 setDependent(e, "cl_decals", 1, 1);
168 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Distance:")));
169 setDependent(e, "cl_decals", 1, 1);
170 me.TD(me, 1, 2, e = makeXonoticSlider_T(200, 500, 20, "r_drawdecals_drawdistance",
171 _("Decals further away than this will not be drawn (default: 300)")));
172 setDependent(e, "cl_decals", 1, 1);
175 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Time:")));
176 setDependent(e, "cl_decals", 1, 1);
177 me.TD(me, 1, 2, e = makeXonoticSlider_T(1, 20, 1, "cl_decals_fadetime",
178 _("Time in seconds before decals fade away (default: 2)")));
179 setDependent(e, "cl_decals", 1, 1);
182 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Damage effects:")));
183 me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_damageeffect"));
184 e.addValue(e, ZCTX(_("DMGFX^Disabled")), "0");
185 e.addValue(e, _("Skeletal"), "1");
186 e.addValue(e, ZCTX(_("DMGFX^All")), "2");
187 e.configureXonoticTextSliderValues(e);
189 me.gotoRC(me, 1.25, 3.2); me.setFirstColumn(me, me.currentColumn);
190 me.TD(me, 1, 3, e = makeXonoticRadioButton_T(1, "r_coronas", "0", _("No dynamic lighting"),
191 _("Enable corona flares around certain lights (default: enabled)")));
193 me.TD(me, 1, 3, e = makeXonoticRadioButton_T(1, "gl_flashblend", string_null, _("Fake corona lighting"),
194 _("Enable faster but uglier dynamic lights by rendering bright coronas instead of real dynamic lights (default: disabled)")));
195 makeMulti(e, "r_coronas");
197 me.TD(me, 1, 2, e = makeXonoticRadioButton_T(1, "r_shadow_realtime_dlight", string_null, _("Realtime dynamic lighting"),
198 _("Enable rendering of dynamic lights such as explosions and rocket lights (default: enabled)")));
199 makeMulti(e, "r_coronas");
200 me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "r_shadow_realtime_dlight_shadows", _("Shadows"),
201 _("Enable rendering of shadows from dynamic lights (default: disabled)")));
202 setDependent(e, "r_shadow_realtime_dlight", 1, 1);
204 me.TD(me, 1, 2, e = makeXonoticCheckBox_T(0, "r_shadow_realtime_world", _("Realtime world lighting"),
205 _("Enable rendering of full realtime world lighting on maps that support it. Note that this might have a big impact on performance. (default: disabled)")));
206 me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "r_shadow_realtime_world_shadows", _("Shadows"),
207 _("Enable rendering of shadows from realtime world lights (default: disabled)")));
208 setDependent(e, "r_shadow_realtime_world", 1, 1);
211 me.TD(me, 1, 1.8, e = makeXonoticCheckBox_T(0, "r_shadow_usenormalmap", _("Use normal maps"),
212 _("Enable use of directional shading on textures (default: enabled)")));
213 setDependentOR(e, "r_shadow_realtime_dlight", 1, 1, "r_shadow_realtime_world", 1, 1);
214 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_shadow_shadowmapping", _("Soft shadows")));
215 setDependentWeird(e, someShadowCvarIsEnabled);
218 me.TD(me, 1, 2.8, e = makeXonoticCheckBox_T(0, "r_coronas_occlusionquery", _("Fade corona according to visibility"),
219 _("Fade coronas according to visibility (default: enabled)")));
220 setDependent(e, "r_coronas", 1, 1);
223 me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "r_bloom", _("Bloom"),
224 _("Enable bloom effect, which brightens the neighboring pixels of very bright pixels. Has a big impact on performance. (default: disabled)")));
225 me.TD(me, 1, 2, e = makeXonoticCheckBoxEx_T(0.5, 0, "hud_postprocessing_maxbluralpha", _("Extra postprocessing effects"),
226 _("Enables special postprocessing effects for when damaged or under water or using a powerup (default: disabled)")));
227 makeMulti(e, "hud_powerup");
228 setDependent(e, "vid_gl20", 1, 1);
230 s = makeXonoticSlider_T(0.1, 1, 0.1, "r_motionblur",
231 _("Motion blur strength - 0.4 recommended"));
232 me.TD(me, 1, 1, e = makeXonoticSliderCheckBox(0, 1, s, _("Motion blur:")));
233 if(s.value != e.savedValue)
234 e.savedValue = 0.4; // default
238 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "cl_particles", _("Particles")));
239 me.TD(me, 1, 2, e = makeXonoticCheckBox_T(0, "cl_spawn_point_particles", _("Spawnpoint effects"),
240 _("Particles effects at all spawn points and whenever a player spawns")));
241 makeMulti(e, "cl_spawn_event_particles");
242 setDependent(e, "cl_particles", 1, 1);
245 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Quality:")));
246 setDependent(e, "cl_particles", 1, 1);
247 me.TD(me, 1, 2, e = makeXonoticParticlesSlider());
248 setDependent(e, "cl_particles", 1, 1);
251 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Distance:")));
252 setDependent(e, "cl_particles", 1, 1);
253 me.TD(me, 1, 2, e = makeXonoticSlider_T(200, 500, 20, "r_drawparticles_drawdistance",
254 _("Particles further away than this will not be drawn (default: 1000)")));
255 setDependent(e, "cl_particles", 1, 1);
257 me.gotoRC(me, me.rows - 1, 0);
258 me.TD(me, 1, me.columns, effectsApplyButton);