1 #ifndef DIALOG_SETTINGS_EFFECTS_H
2 #define DIALOG_SETTINGS_EFFECTS_H
4 CLASS(XonoticEffectsSettingsTab, XonoticTab)
5 METHOD(XonoticEffectsSettingsTab, fill, void(entity));
6 ATTRIB(XonoticEffectsSettingsTab, intendedWidth, float, 0.9)
7 ATTRIB(XonoticEffectsSettingsTab, rows, float, 15.5)
8 ATTRIB(XonoticEffectsSettingsTab, columns, float, 6.2) // added extra .2 for center space
9 ENDCLASS(XonoticEffectsSettingsTab)
10 entity makeXonoticEffectsSettingsTab();
14 entity makeXonoticEffectsSettingsTab()
17 me = NEW(XonoticEffectsSettingsTab);
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 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^OMG!")), '1 0 1', "exec effects-omg.cfg", 0));
42 me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Low")), '0 0 0', "exec effects-low.cfg", 0));
43 me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Medium")), '0 0 0', "exec effects-med.cfg", 0));
44 me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Normal")), '0 0 0', "exec effects-normal.cfg", 0));
45 me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^High")), '0 0 0', "exec effects-high.cfg", 0));
46 me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Ultra")), '0 0 0', "exec effects-ultra.cfg", 0));
48 me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Ultimate")), '0.5 0 0', "exec effects-ultimate.cfg", 0));
50 me.gotoRC(me, 1.25, 0);
51 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Geometry detail:")));
52 me.TD(me, 1, 2, e = makeXonoticTextSlider_T("r_subdivisions_tolerance",
53 _("Change the smoothness of the curves on the map (default: normal)")));
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, e = makeXonoticTextLabel(0, _("Player detail:")));
63 me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_playerdetailreduction"));
64 e.addValue(e, ZCTX(_("PDET^Low")), "4");
65 e.addValue(e, ZCTX(_("PDET^Medium")), "3");
66 e.addValue(e, ZCTX(_("PDET^Normal")), "2");
67 e.addValue(e, ZCTX(_("PDET^Good")), "1");
68 e.addValue(e, ZCTX(_("PDET^Best")), "0");
69 e.configureXonoticTextSliderValues(e);
71 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Texture resolution:")));
72 setDependent(e, "r_showsurfaces", 0, 0);
73 me.TD(me, 1, 2, e = makeXonoticPicmipSlider());
75 e.addValue(e, ZCTX(_("RES^Leet")), "1337");
76 e.addValue(e, ZCTX(_("RES^Lowest")), "3");
77 e.addValue(e, ZCTX(_("RES^Very low")), "2");
78 e.addValue(e, ZCTX(_("RES^Low")), "1");
79 e.addValue(e, ZCTX(_("RES^Normal")), "0");
80 e.addValue(e, ZCTX(_("RES^Good")), "-1");
81 e.addValue(e, ZCTX(_("RES^Best")), "-2");
82 e.configureXonoticTextSliderValues(e);
83 setDependent(e, "r_showsurfaces", 0, 0);
87 // detect texture compression method
89 f = updateCompression();
93 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(1, "r_texture_dds_load", _("Avoid lossy texture compression")));
94 e.disabled = 1; // just show the checkbox anyway, but with no ability to control it
97 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(1, "r_texture_dds_load", _("Avoid lossy texture compression")));
98 setDependent(e, "r_showsurfaces", 0, 0);
101 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(1, "r_texture_dds_load", _("Avoid lossy texture compression")));
102 setDependent(e, "r_showsurfaces", 0, 0);
103 makeMulti(e, "gl_texturecompression");
108 if(cvar("developer"))
111 me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx_T(3, 0, "r_showsurfaces", _("Show surfaces"),
112 _("Disable textures completely for very slow hardware. This gives a huge performance boost, but looks very ugly. (default: disabled)")));
115 me.TD(me, 1, 1, e = makeXonoticCheckBox_T(1, "mod_q3bsp_nolightmaps", _("Use lightmaps"),
116 _("Use high resolution lightmaps, which will look pretty but use up some extra video memory (default: enabled)")));
117 me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "r_glsl_deluxemapping", _("Deluxe mapping"),
118 _("Use per-pixel lighting effects (default: enabled)")));
119 setDependentAND(e, "vid_gl20", 1, 1, "mod_q3bsp_nolightmaps", 0, 0);
120 me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "r_shadow_gloss", _("Gloss"),
121 _("Enable the use of glossmaps on textures supporting it (default: enabled)")));
122 setDependentAND3(e, "vid_gl20", 1, 1, "mod_q3bsp_nolightmaps", 0, 0, "r_glsl_deluxemapping", 1, 1);
124 me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "r_glsl_offsetmapping", _("Offset mapping"),
125 _("Offset mapping effect that will make textures with bumpmaps appear like they \"pop out\" of the flat 2D surface (default: disabled)")));
126 setDependent(e, "vid_gl20", 1, 1);
127 me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "r_glsl_offsetmapping_reliefmapping", _("Relief mapping"),
128 _("Higher quality offset mapping, which also has a huge impact on performance (default: disabled)")));
129 setDependentAND(e, "vid_gl20", 1, 1, "r_glsl_offsetmapping", 1, 1);
131 me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "r_water", _("Reflections:"),
132 _("Reflection and refraction quality, has a huge impact on performance on maps with reflecting surfaces (default: disabled)")));
133 setDependent(e, "vid_gl20", 1, 1);
134 me.TD(me, 1, 2, e = makeXonoticTextSlider_T("r_water_resolutionmultiplier",
135 _("Resolution of reflections/refractions (default: good)")));
136 e.addValue(e, _("Blurred"), "0.25");
137 e.addValue(e, ZCTX(_("REFL^Good")), "0.5");
138 e.addValue(e, _("Sharp"), "1");
139 e.configureXonoticTextSliderValues(e);
140 setDependentAND(e, "vid_gl20", 1, 1, "r_water", 1, 1);
142 me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "cl_decals", _("Decals"),
143 _("Enable decals (bullet holes and blood) (default: enabled)")));
144 me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "cl_decals_models", _("Decals on models")));
145 setDependent(e, "cl_decals", 1, 1);
148 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Distance:")));
149 setDependent(e, "cl_decals", 1, 1);
150 me.TD(me, 1, 2, e = makeXonoticSlider_T(200, 500, 20, "r_drawdecals_drawdistance",
151 _("Decals further away than this will not be drawn (default: 300)")));
152 setDependent(e, "cl_decals", 1, 1);
155 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Time:")));
156 setDependent(e, "cl_decals", 1, 1);
157 me.TD(me, 1, 2, e = makeXonoticSlider_T(1, 20, 1, "cl_decals_fadetime",
158 _("Time in seconds before decals fade away (default: 2)")));
159 setDependent(e, "cl_decals", 1, 1);
162 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Damage effects:")));
163 me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_damageeffect"));
164 e.addValue(e, ZCTX(_("DMGFX^Disabled")), "0");
165 e.addValue(e, _("Skeletal"), "1");
166 e.addValue(e, ZCTX(_("DMGFX^All")), "2");
167 e.configureXonoticTextSliderValues(e);
169 me.gotoRC(me, 1.25, 3.2); me.setFirstColumn(me, me.currentColumn);
170 me.TD(me, 1, 3, e = makeXonoticRadioButton_T(1, "r_coronas", "0", _("No dynamic lighting"),
171 _("Enable corona flares around certain lights (default: enabled)")));
173 me.TD(me, 1, 3, e = makeXonoticRadioButton_T(1, "gl_flashblend", string_null, _("Fake corona lighting"),
174 _("Enable faster but uglier dynamic lights by rendering bright coronas instead of real dynamic lights (default: disabled)")));
175 makeMulti(e, "r_coronas");
177 me.TD(me, 1, 2, e = makeXonoticRadioButton_T(1, "r_shadow_realtime_dlight", string_null, _("Realtime dynamic lighting"),
178 _("Enable rendering of dynamic lights such as explosions and rocket lights (default: enabled)")));
179 makeMulti(e, "r_coronas");
180 me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "r_shadow_realtime_dlight_shadows", _("Shadows"),
181 _("Enable rendering of shadows from dynamic lights (default: disabled)")));
182 setDependent(e, "r_shadow_realtime_dlight", 1, 1);
184 me.TD(me, 1, 2, e = makeXonoticCheckBox_T(0, "r_shadow_realtime_world", _("Realtime world lighting"),
185 _("Enable rendering of full realtime world lighting on maps that support it. Note that this might have a big impact on performance. (default: disabled)")));
186 me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "r_shadow_realtime_world_shadows", _("Shadows"),
187 _("Enable rendering of shadows from realtime world lights (default: disabled)")));
188 setDependent(e, "r_shadow_realtime_world", 1, 1);
191 me.TD(me, 1, 1.8, e = makeXonoticCheckBox_T(0, "r_shadow_usenormalmap", _("Use normal maps"),
192 _("Enable use of directional shading on textures (default: enabled)")));
193 setDependentOR(e, "r_shadow_realtime_dlight", 1, 1, "r_shadow_realtime_world", 1, 1);
194 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_shadow_shadowmapping", _("Soft shadows")));
195 setDependentWeird(e, someShadowCvarIsEnabled);
198 me.TD(me, 1, 2.8, e = makeXonoticCheckBox_T(0, "r_coronas_occlusionquery", _("Fade corona according to visibility"),
199 _("Fade coronas according to visibility (default: enabled)")));
200 setDependent(e, "r_coronas", 1, 1);
203 me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "r_bloom", _("Bloom"),
204 _("Enable bloom effect, which brightens the neighboring pixels of very bright pixels. Has a big impact on performance. (default: disabled)")));
205 me.TD(me, 1, 2, e = makeXonoticCheckBoxEx_T(0.5, 0, "hud_postprocessing_maxbluralpha", _("Extra postprocessing effects"),
206 _("Enables special postprocessing effects for when damaged or under water or using a powerup (default: disabled)")));
207 makeMulti(e, "hud_powerup");
208 setDependent(e, "vid_gl20", 1, 1);
210 s = makeXonoticSlider_T(0.1, 1, 0.1, "r_motionblur",
211 _("Motion blur strength - 0.4 recommended"));
212 me.TD(me, 1, 1, e = makeXonoticSliderCheckBox(0, 1, s, _("Motion blur:")));
213 if(s.value != e.savedValue)
214 e.savedValue = 0.4; // default
218 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "cl_particles", _("Particles")));
219 me.TD(me, 1, 2, e = makeXonoticCheckBox_T(0, "cl_spawn_point_particles", _("Spawnpoint effects"),
220 _("Particles effects at all spawn points and whenever a player spawns")));
221 makeMulti(e, "cl_spawn_event_particles");
222 setDependent(e, "cl_particles", 1, 1);
225 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Quality:")));
226 setDependent(e, "cl_particles", 1, 1);
227 me.TD(me, 1, 2, e = makeXonoticParticlesSlider());
228 setDependent(e, "cl_particles", 1, 1);
231 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Distance:")));
232 setDependent(e, "cl_particles", 1, 1);
233 me.TD(me, 1, 2, e = makeXonoticSlider_T(200, 500, 20, "r_drawparticles_drawdistance",
234 _("Particles further away than this will not be drawn (default: 1000)")));
235 setDependent(e, "cl_particles", 1, 1);
237 me.gotoRC(me, me.rows - 1, 0);
238 me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "vid_restart", COMMANDBUTTON_APPLY));