Skip to content

Commit d354433

Browse files
committed
New options that allow you to configure dynamic wet surfaces
1 parent 886de2b commit d354433

File tree

11 files changed

+159
-5
lines changed

11 files changed

+159
-5
lines changed

res/gamedata/configs/text/eng/ui_st_mm.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,18 @@
636636
<string id="ui_mm_r3_dynamic_wet_surfaces">
637637
<text>Wet surfaces</text>
638638
</string>
639+
<string id="ui_mm_r3_dynamic_wet_surfaces_opt">
640+
<text>Wet surfaces optimization</text>
641+
</string>
642+
<string id="ui_mm_r3_dynamic_wet_surfaces_near">
643+
<text>Wet surfaces near dist.</text>
644+
</string>
645+
<string id="ui_mm_r3_dynamic_wet_surfaces_far">
646+
<text>Wet surfaces far dist.</text>
647+
</string>
648+
<string id="ui_mm_r3_dynamic_wet_surfaces_sm_res">
649+
<text>Wet surfaces quality</text>
650+
</string>
639651
<string id="ui_mm_r3_gbuffer_opt">
640652
<text>Optimize geometric buffer</text>
641653
</string>

res/gamedata/configs/text/rus/ui_st_mm.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,18 @@
636636
<string id="ui_mm_r3_dynamic_wet_surfaces">
637637
<text>Íàìîêàíèå ïëîñêîñòåé</text>
638638
</string>
639+
<string id="ui_mm_r3_dynamic_wet_surfaces_opt">
640+
<text>Îïòèìèçàöèÿ íàìîêàíèÿ</text>
641+
</string>
642+
<string id="ui_mm_r3_dynamic_wet_surfaces_near">
643+
<text>Íàìîêàíèå âáëèçè</text>
644+
</string>
645+
<string id="ui_mm_r3_dynamic_wet_surfaces_far">
646+
<text>Íàìîêàíèå âäàëè</text>
647+
</string>
648+
<string id="ui_mm_r3_dynamic_wet_surfaces_sm_res">
649+
<text>Êà÷åñòâî íàìîêàíèÿ</text>
650+
</string>
639651
<string id="ui_mm_r3_gbuffer_opt">
640652
<text>Îïòèìèçèðîâàòü ãåîìåòð. áóôåð</text>
641653
</string>

res/gamedata/configs/ui/ui_mm_opt.xml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,11 +278,45 @@
278278
<cap_r3_dynamic_wet_surfaces x="20" y="3" width="135" height="24">
279279
<text r="170" g="170" b="170" font="letterica16" align="r" vert_align="c">ui_mm_r3_dynamic_wet_surfaces</text>
280280
</cap_r3_dynamic_wet_surfaces>
281+
281282
<check_r3_dynamic_wet_surfaces x="167" y="0" width="44" height="29">
282283
<texture>ui_inGame2_checkbox</texture>
283284
<options_item entry="r3_dynamic_wet_surfaces" group="mm_opt_video"/>
284285
</check_r3_dynamic_wet_surfaces>
285286

287+
<cap_r3_dynamic_wet_surfaces_opt x="20" y="3" width="135" height="24">
288+
<text r="170" g="170" b="170" font="letterica16" align="r" vert_align="c">ui_mm_r3_dynamic_wet_surfaces_opt</text>
289+
</cap_r3_dynamic_wet_surfaces_opt>
290+
291+
<check_r3_dynamic_wet_surfaces_opt x="167" y="0" width="44" height="29">
292+
<texture>ui_inGame2_checkbox</texture>
293+
<options_item entry="r3_dynamic_wet_surfaces_opt" group="mm_opt_video" is_integer="1" depend="vid"/>
294+
</check_r3_dynamic_wet_surfaces_opt>
295+
296+
<cap_r3_dynamic_wet_surfaces_near x="20" y="3" width="135" height="24">
297+
<text r="170" g="170" b="170" font="letterica16" align="r" vert_align="c">ui_mm_r3_dynamic_wet_surfaces_near</text>
298+
</cap_r3_dynamic_wet_surfaces_near>
299+
300+
<track_r3_dynamic_wet_surfaces_near x="175" y="97" width="235" height="16">
301+
<options_item entry="r3_dynamic_wet_surfaces_near" group="mm_opt_video" depend="runtime"/>
302+
</track_r3_dynamic_wet_surfaces_near>
303+
304+
<cap_r3_dynamic_wet_surfaces_far x="20" y="3" width="135" height="24">
305+
<text r="170" g="170" b="170" font="letterica16" align="r" vert_align="c">ui_mm_r3_dynamic_wet_surfaces_far</text>
306+
</cap_r3_dynamic_wet_surfaces_far>
307+
308+
<track_r3_dynamic_wet_surfaces_far x="175" y="97" width="235" height="16">
309+
<options_item entry="r3_dynamic_wet_surfaces_far" group="mm_opt_video" depend="runtime"/>
310+
</track_r3_dynamic_wet_surfaces_far>
311+
312+
<cap_r3_dynamic_wet_surfaces_sm_res x="20" y="3" width="135" height="24">
313+
<text r="170" g="170" b="170" font="letterica16" align="r" vert_align="c">ui_mm_r3_dynamic_wet_surfaces_sm_res</text>
314+
</cap_r3_dynamic_wet_surfaces_sm_res>
315+
316+
<track_r3_dynamic_wet_surfaces_sm_res x="175" y="97" width="235" height="16" step="16" is_integer="1">
317+
<options_item entry="r3_dynamic_wet_surfaces_sm_res" group="mm_opt_video" depend="runtime"/>
318+
</track_r3_dynamic_wet_surfaces_sm_res>
319+
286320
<cap_r3_volumetric_smoke x="20" y="3" width="135" height="24">
287321
<text r="170" g="170" b="170" font="letterica16" align="r" vert_align="c">ui_mm_r3_volumetric_smoke</text>
288322
</cap_r3_volumetric_smoke>

res/gamedata/configs/ui/ui_mm_opt_16.xml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,11 +281,45 @@
281281
<cap_r3_dynamic_wet_surfaces x="16" y="3" width="108" height="24">
282282
<text r="170" g="170" b="170" font="letterica16" align="r" vert_align="c">ui_mm_r3_dynamic_wet_surfaces</text>
283283
</cap_r3_dynamic_wet_surfaces>
284+
284285
<check_r3_dynamic_wet_surfaces x="133" y="0" width="35" stretch="1" height="29">
285286
<texture>ui_inGame2_checkbox</texture>
286287
<options_item entry="r3_dynamic_wet_surfaces" group="mm_opt_video"/>
287288
</check_r3_dynamic_wet_surfaces>
288289

290+
<cap_r3_dynamic_wet_surfaces_opt x="16" y="3" width="108" height="24">
291+
<text r="170" g="170" b="170" font="letterica16" align="r" vert_align="c">ui_mm_r3_dynamic_wet_surfaces_opt</text>
292+
</cap_r3_dynamic_wet_surfaces_opt>
293+
294+
<check_r3_dynamic_wet_surfaces_opt x="133" y="0" width="35" stretch="1" height="29">
295+
<texture>ui_inGame2_checkbox</texture>
296+
<options_item entry="r3_dynamic_wet_surfaces_opt" group="mm_opt_video" is_integer="1" depend="vid"/>
297+
</check_r3_dynamic_wet_surfaces_opt>
298+
299+
<cap_r3_dynamic_wet_surfaces_near x="16" y="3" width="108" height="24">
300+
<text r="170" g="170" b="170" font="letterica16" align="r" vert_align="c">ui_mm_r3_dynamic_wet_surfaces_near</text>
301+
</cap_r3_dynamic_wet_surfaces_near>
302+
303+
<track_r3_dynamic_wet_surfaces_near x="144" y="6" width="188" height="16">
304+
<options_item entry="r3_dynamic_wet_surfaces_near" group="mm_opt_video" depend="runtime"/>
305+
</track_r3_dynamic_wet_surfaces_near>
306+
307+
<cap_r3_dynamic_wet_surfaces_far x="16" y="3" width="108" height="24">
308+
<text r="170" g="170" b="170" font="letterica16" align="r" vert_align="c">ui_mm_r3_dynamic_wet_surfaces_far</text>
309+
</cap_r3_dynamic_wet_surfaces_far>
310+
311+
<track_r3_dynamic_wet_surfaces_far x="144" y="6" width="188" height="16">
312+
<options_item entry="r3_dynamic_wet_surfaces_far" group="mm_opt_video" depend="runtime"/>
313+
</track_r3_dynamic_wet_surfaces_far>
314+
315+
<cap_r3_dynamic_wet_surfaces_sm_res x="16" y="3" width="108" height="24">
316+
<text r="170" g="170" b="170" font="letterica16" align="r" vert_align="c">ui_mm_r3_dynamic_wet_surfaces_sm_res</text>
317+
</cap_r3_dynamic_wet_surfaces_sm_res>
318+
319+
<track_r3_dynamic_wet_surfaces_sm_res x="144" y="6" width="188" height="16" step="16" is_integer="1">
320+
<options_item entry="r3_dynamic_wet_surfaces_sm_res" group="mm_opt_video" depend="runtime"/>
321+
</track_r3_dynamic_wet_surfaces_sm_res>
322+
289323
<cap_r3_volumetric_smoke x="16" y="3" width="108" height="24">
290324
<text r="170" g="170" b="170" font="letterica16" align="r" vert_align="c">ui_mm_r3_volumetric_smoke</text>
291325
</cap_r3_volumetric_smoke>

res/gamedata/scripts/ui_mm_opt_main.script

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,30 @@ function options_dialog:UpdateDependControls()
135135
self:OnAOOptionChange()
136136
end
137137

138+
function options_dialog:OnDynWetSurfNearUpdate()
139+
local near = self.track_r3_dyn_wet_surf_near:GetFValue()
140+
local far = self.track_r3_dyn_wet_surf_far:GetFValue()
141+
142+
if (near > far) then
143+
local console = get_console()
144+
console:execute("r3_dynamic_wet_surfaces_far " .. near + 1)
145+
end
146+
147+
self.track_r3_dyn_wet_surf_far:SetCurrentValue()
148+
end
149+
150+
function options_dialog:OnDynWetSurfFarUpdate()
151+
local near = self.track_r3_dyn_wet_surf_near:GetFValue()
152+
local far = self.track_r3_dyn_wet_surf_far:GetFValue()
153+
154+
if (far < near) then
155+
local console = get_console()
156+
console:execute("r3_dynamic_wet_surfaces_near " .. far - 1)
157+
end
158+
159+
self.track_r3_dyn_wet_surf_near:SetCurrentValue()
160+
end
161+
138162
function options_dialog:InitCallBacks()
139163
self:AddCallback("tab", ui_events.TAB_CHANGED, self.OnTabChange, self)
140164
self:AddCallback("btn_advanced_graphic",ui_events.BUTTON_CLICKED, self.OnBtnAdvGraphic, self)
@@ -149,6 +173,9 @@ function options_dialog:InitCallBacks()
149173
self:AddCallback("combo_renderer", ui_events.LIST_ITEM_SELECT, self.UpdateDependControls, self)
150174
self:AddCallback("btn_cancel_download", ui_events.BUTTON_CLICKED, self.OnBtn_CancelDownload, self)
151175
self:AddCallback("tab_ao_opt", ui_events.TAB_CHANGED, self.OnAOOptionChange, self)
176+
self:AddCallback("track_r3_dyn_wet_surf_near", ui_events.BUTTON_CLICKED, self.OnDynWetSurfNearUpdate, self)
177+
self:AddCallback("track_r3_dyn_wet_surf_far", ui_events.BUTTON_CLICKED, self.OnDynWetSurfFarUpdate, self)
178+
152179

153180
self:AddCallback("mb", ui_events.MESSAGE_BOX_YES_CLICKED, self.OnApplyChanges, self)
154181
self:AddCallback("mb", ui_events.MESSAGE_BOX_NO_CLICKED, self.OnDiscardChanges,self)

res/gamedata/scripts/ui_mm_opt_video_adv.script

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,30 @@ function opt_video_adv:InitControls(x, y, xml, handler)
210210
ctl = xml:InitCheck ("video_adv:check_r3_dynamic_wet_surfaces", _st)
211211
table.insert(handler.m_preconditions, {func=mode_ge_3, control=_st})
212212

213+
_st = xml:InitStatic("video_adv:templ_item", nil)
214+
xml:InitStatic("video_adv:cap_r3_dynamic_wet_surfaces_opt", _st)
215+
ctl = xml:InitCheck ("video_adv:check_r3_dynamic_wet_surfaces_opt", _st)
216+
table.insert(handler.m_preconditions, {func=mode_ge_3, control=_st})
217+
218+
_st = xml:InitStatic("video_adv:templ_item", nil)
219+
xml:InitStatic("video_adv:cap_r3_dynamic_wet_surfaces_near", _st)
220+
ctl = xml:InitTrackBar("video_adv:track_r3_dynamic_wet_surfaces_near", _st)
221+
handler.track_r3_dyn_wet_surf_near = ctl
222+
handler:Register(ctl, "track_r3_dyn_wet_surf_near")
223+
table.insert(handler.m_preconditions, {func=mode_ge_3, control=_st})
224+
225+
_st = xml:InitStatic("video_adv:templ_item", nil)
226+
xml:InitStatic("video_adv:cap_r3_dynamic_wet_surfaces_far", _st)
227+
ctl = xml:InitTrackBar("video_adv:track_r3_dynamic_wet_surfaces_far", _st)
228+
handler.track_r3_dyn_wet_surf_far = ctl
229+
handler:Register(ctl, "track_r3_dyn_wet_surf_far")
230+
table.insert(handler.m_preconditions, {func=mode_ge_3, control=_st})
231+
232+
_st = xml:InitStatic("video_adv:templ_item", nil)
233+
xml:InitStatic("video_adv:cap_r3_dynamic_wet_surfaces_sm_res", _st)
234+
ctl = xml:InitTrackBar("video_adv:track_r3_dynamic_wet_surfaces_sm_res", _st)
235+
table.insert(handler.m_preconditions, {func=mode_ge_2, control=_st})
236+
213237
-- r3_volumetric_smoke >r25
214238
_st = xml:InitStatic("video_adv:templ_item", nil)
215239
xml:InitStatic("video_adv:cap_r3_volumetric_smoke", _st)
34 Bytes
Binary file not shown.

src/Layers/xrRender/xrRender_console.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,9 @@ Fvector3 ps_r2_dof = Fvector3().set(-1.25f, 1.4f, 600.f);
189189
float ps_r2_dof_sky = 30; // distance to sky
190190
float ps_r2_dof_kernel_size = 5.0f; // 7.0f
191191

192-
float ps_r3_dyn_wet_surf_near = 10.f; // 10.0f
193-
float ps_r3_dyn_wet_surf_far = 30.f; // 30.0f
192+
int ps_r3_dyn_wet_surf_opt = 1;
193+
float ps_r3_dyn_wet_surf_near = 5.f; // 10.0f
194+
float ps_r3_dyn_wet_surf_far = 20.f; // 30.0f
194195
int ps_r3_dyn_wet_surf_sm_res = 256; // 256
195196

196197
//AVO: detail draw radius
@@ -909,7 +910,8 @@ void xrRender_initconsole()
909910
#endif // (RENDER == R_R3) || (RENDER == R_R4)
910911

911912
CMD3(CCC_Mask, "r3_dynamic_wet_surfaces", &ps_r2_ls_flags, R3FLAG_DYN_WET_SURF);
912-
CMD4(CCC_Float, "r3_dynamic_wet_surfaces_near", &ps_r3_dyn_wet_surf_near, 10, 70);
913+
CMD4(CCC_Integer, "r3_dynamic_wet_surfaces_opt", &ps_r3_dyn_wet_surf_opt, 0, 1);
914+
CMD4(CCC_Float, "r3_dynamic_wet_surfaces_near", &ps_r3_dyn_wet_surf_near, 5, 70);
913915
CMD4(CCC_Float, "r3_dynamic_wet_surfaces_far", &ps_r3_dyn_wet_surf_far, 30, 100);
914916
CMD4(CCC_Integer, "r3_dynamic_wet_surfaces_sm_res", &ps_r3_dyn_wet_surf_sm_res, 64, 2048);
915917

src/Layers/xrRender/xrRender_console.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ extern ECORE_API Fvector3 ps_r2_dof;
134134
extern ECORE_API float ps_r2_dof_sky; // distance to sky
135135
extern ECORE_API float ps_r2_dof_kernel_size; // 7.0f
136136

137+
extern ECORE_API int ps_r3_dyn_wet_surf_opt;
137138
extern ECORE_API float ps_r3_dyn_wet_surf_near; // 10.0f
138139
extern ECORE_API float ps_r3_dyn_wet_surf_far; // 30.0f
139140
extern ECORE_API int ps_r3_dyn_wet_surf_sm_res; // 256

src/Layers/xrRenderDX10/DX10 Rain/dx10RainBlender.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ void CBlender_rain::Compile(CBlender_Compile& C)
4040
// C.r_Pass ("stub_notransform_2uv", "rain_layer", false, TRUE, FALSE, TRUE, D3DBLEND_ONE, D3DBLEND_ONE);
4141
// C.r_Pass ("stub_notransform_2uv", "rain_layer", false, TRUE, FALSE, TRUE, D3DBLEND_SRCALPHA,
4242
// D3DBLEND_INVSRCALPHA);
43-
C.r_Pass("stub_notransform_2uv", "rain_patch_normal_nomsaa", false, TRUE, FALSE, FALSE);
43+
if (ps_r3_dyn_wet_surf_opt)
44+
C.r_Pass("stub_notransform_2uv", "rain_patch_normal_nomsaa", false, TRUE, FALSE, FALSE);
45+
else
46+
C.r_Pass("stub_notransform_2uv", "rain_patch_normal_new_nomsaa", false, TRUE, FALSE, FALSE);
4447
C.PassSET_ZB(TRUE, FALSE, TRUE); // force inverted Z-Buffer
4548

4649
C.r_dx10Texture("s_position", r2_RT_P);
@@ -165,7 +168,10 @@ void CBlender_rain_msaa::Compile(CBlender_Compile& C)
165168
// C.r_Pass ("stub_notransform_2uv", "rain_layer", false, TRUE, FALSE, TRUE, D3DBLEND_ONE, D3DBLEND_ONE);
166169
// C.r_Pass ("stub_notransform_2uv", "rain_layer", false, TRUE, FALSE, TRUE, D3DBLEND_SRCALPHA,
167170
// D3DBLEND_INVSRCALPHA);
168-
C.r_Pass("stub_notransform_2uv", "rain_patch_normal_msaa", false, TRUE, FALSE, FALSE);
171+
if (ps_r3_dyn_wet_surf_opt)
172+
C.r_Pass("stub_notransform_2uv", "rain_patch_normal_msaa", false, TRUE, FALSE, FALSE);
173+
else
174+
C.r_Pass("stub_notransform_2uv", "rain_patch_normal_new_msaa", false, TRUE, FALSE, FALSE);
169175
C.PassSET_ZB(TRUE, FALSE, TRUE); // force inverted Z-Buffer
170176

171177
C.r_dx10Texture("s_position", r2_RT_P);

0 commit comments

Comments
 (0)