Skip to content

Commit c85880a

Browse files
committed
#3371 Texture resolution cap
1 parent f490bf6 commit c85880a

File tree

4 files changed

+76
-11
lines changed

4 files changed

+76
-11
lines changed

indra/newview/featuretable.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ RenderExposure 1 4
8585
RenderTonemapType 1 1
8686
RenderTonemapMix 1 1
8787
RenderDisableVintageMode 1 1
88+
RenderMaxTextureResolution 1 2048
8889

8990
//
9091
// Low Graphics Settings
@@ -126,6 +127,7 @@ RenderExposure 1 1
126127
RenderTonemapType 1 1
127128
RenderTonemapMix 1 0.7
128129
RenderDisableVintageMode 1 0
130+
RenderMaxTextureResolution 1 512
129131

130132
//
131133
// Medium Low Graphics Settings
@@ -167,6 +169,7 @@ RenderExposure 1 1
167169
RenderTonemapType 1 1
168170
RenderTonemapMix 1 0.7
169171
RenderDisableVintageMode 1 0
172+
RenderMaxTextureResolution 1 1024
170173

171174
//
172175
// Medium Graphics Settings (standard)
@@ -207,6 +210,7 @@ RenderCASSharpness 1 0
207210
RenderExposure 1 1
208211
RenderTonemapType 1 1
209212
RenderTonemapMix 1 0.7
213+
RenderMaxTextureResolution 1 2048
210214

211215
//
212216
// Medium High Graphics Settings
@@ -247,6 +251,7 @@ RenderCASSharpness 1 0
247251
RenderExposure 1 1
248252
RenderTonemapType 1 1
249253
RenderTonemapMix 1 0.7
254+
RenderMaxTextureResolution 1 2048
250255

251256
//
252257
// High Graphics Settings (SSAO + sun shadows)
@@ -287,6 +292,7 @@ RenderCASSharpness 1 0.4
287292
RenderExposure 1 1
288293
RenderTonemapType 1 1
289294
RenderTonemapMix 1 0.7
295+
RenderMaxTextureResolution 1 2048
290296

291297
//
292298
// High Ultra Graphics Settings (deferred + SSAO + all shadows)
@@ -327,6 +333,7 @@ RenderCASSharpness 1 0.4
327333
RenderExposure 1 1
328334
RenderTonemapType 1 1
329335
RenderTonemapMix 1 0.7
336+
RenderMaxTextureResolution 1 2048
330337

331338
//
332339
// Ultra graphics (REALLY PURTY!)
@@ -367,6 +374,7 @@ RenderCASSharpness 1 0.4
367374
RenderExposure 1 1
368375
RenderTonemapType 1 1
369376
RenderTonemapMix 1 0.7
377+
RenderMaxTextureResolution 1 2048
370378

371379
//
372380
// Class Unknown Hardware (unknown)
@@ -399,6 +407,7 @@ RenderShadowDetail 0 0
399407
RenderReflectionProbeDetail 0 -1
400408
RenderMirrors 0 0
401409
RenderDisableVintageMode 1 0
410+
RenderMaxTextureResolution 1 2048
402411

403412
list Intel
404413
RenderAnisotropic 1 0

indra/newview/featuretable_mac.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ RenderTonemapType 1 1
8585
RenderTonemapMix 1 1
8686
RenderDisableVintageMode 1 1
8787
RenderDownScaleMethod 1 0
88+
RenderMaxTextureResolution 1 2048
8889

8990
//
9091
// Low Graphics Settings
@@ -126,6 +127,7 @@ RenderExposure 1 1
126127
RenderTonemapType 1 1
127128
RenderTonemapMix 1 0.7
128129
RenderDisableVintageMode 1 0
130+
RenderMaxTextureResolution 1 512
129131

130132
//
131133
// Medium Low Graphics Settings
@@ -167,6 +169,7 @@ RenderExposure 1 1
167169
RenderTonemapType 1 1
168170
RenderTonemapMix 1 0.7
169171
RenderDisableVintageMode 1 0
172+
RenderMaxTextureResolution 1 1024
170173

171174
//
172175
// Medium Graphics Settings (standard)
@@ -207,6 +210,7 @@ RenderCASSharpness 1 0
207210
RenderExposure 1 1
208211
RenderTonemapType 1 1
209212
RenderTonemapMix 1 0.7
213+
RenderMaxTextureResolution 1 2048
210214

211215
//
212216
// Medium High Graphics Settings
@@ -247,6 +251,7 @@ RenderCASSharpness 1 0
247251
RenderExposure 1 1
248252
RenderTonemapType 1 1
249253
RenderTonemapMix 1 0.7
254+
RenderMaxTextureResolution 1 2048
250255

251256
//
252257
// High Graphics Settings (SSAO + sun shadows)
@@ -287,6 +292,7 @@ RenderCASSharpness 1 0
287292
RenderExposure 1 1
288293
RenderTonemapType 1 1
289294
RenderTonemapMix 1 0.7
295+
RenderMaxTextureResolution 1 2048
290296

291297
//
292298
// High Ultra Graphics Settings (SSAO + all shadows)
@@ -327,6 +333,7 @@ RenderCASSharpness 1 0.4
327333
RenderExposure 1 1
328334
RenderTonemapType 1 1
329335
RenderTonemapMix 1 0.7
336+
RenderMaxTextureResolution 1 2048
330337

331338
//
332339
// Ultra graphics (REALLY PURTY!)
@@ -367,6 +374,7 @@ RenderCASSharpness 1 0.4
367374
RenderExposure 1 1
368375
RenderTonemapType 1 1
369376
RenderTonemapMix 1 0.7
377+
RenderMaxTextureResolution 1 2048
370378

371379
//
372380
// Class Unknown Hardware (unknown)
@@ -398,6 +406,7 @@ RenderDeferredSSAO 0 0
398406
RenderShadowDetail 0 0
399407
RenderMirrors 0 0
400408
RenderDisableVintageMode 1 0
409+
RenderMaxTextureResolution 1 2048
401410

402411
list TexUnit8orLess
403412
RenderDeferredSSAO 0 0

indra/newview/llviewertexture.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1694,6 +1694,16 @@ void LLViewerFetchedTexture::processTextureStats()
16941694

16951695
static LLCachedControl<bool> textures_fullres(gSavedSettings,"TextureLoadFullRes", false);
16961696

1697+
if (mBoostLevel < LLGLTexture::BOOST_HIGH)
1698+
{
1699+
// restrict texture resolution to download based on RenderMaxTextureResolution
1700+
static LLCachedControl<U32> max_texture_resolution(gSavedSettings, "RenderMaxTextureResolution", 2048);
1701+
// sanity clamp debug setting to avoid settings hack shenanigans
1702+
F32 tex_res = (F32)llclamp((S32)max_texture_resolution, 512, MAX_IMAGE_SIZE_DEFAULT);
1703+
tex_res *= tex_res;
1704+
mMaxVirtualSize = llmin(mMaxVirtualSize, tex_res);
1705+
}
1706+
16971707
if (textures_fullres)
16981708
{
16991709
mDesiredDiscardLevel = 0;
@@ -2948,10 +2958,12 @@ void LLViewerLODTexture::processTextureStats()
29482958

29492959
static LLCachedControl<bool> textures_fullres(gSavedSettings,"TextureLoadFullRes", false);
29502960

2951-
{ // restrict texture resolution to download based on RenderMaxTextureResolution
2961+
if (mBoostLevel < LLGLTexture::BOOST_HIGH)
2962+
{
2963+
// restrict texture resolution to download based on RenderMaxTextureResolution
29522964
static LLCachedControl<U32> max_texture_resolution(gSavedSettings, "RenderMaxTextureResolution", 2048);
29532965
// sanity clamp debug setting to avoid settings hack shenanigans
2954-
F32 tex_res = (F32)llclamp((S32)max_texture_resolution, 512, 2048);
2966+
F32 tex_res = (F32)llclamp((S32)max_texture_resolution, 512, MAX_IMAGE_SIZE_DEFAULT);
29552967
tex_res *= tex_res;
29562968
mMaxVirtualSize = llmin(mMaxVirtualSize, tex_res);
29572969
}

indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
22
<floater
3-
height="430"
3+
height="452"
44
layout="topleft"
55
name="prefs_graphics_advanced"
66
help_topic="Preferences_Graphics_Advanced"
@@ -118,6 +118,41 @@
118118
name="MaxLights"
119119
top_delta="16"
120120
width="336" />
121+
<text
122+
type="string"
123+
length="1"
124+
follows="left|top"
125+
height="16"
126+
layout="topleft"
127+
top_delta="16"
128+
left="30"
129+
width="130"
130+
name="MaxTextureResolutionLabel"
131+
text_readonly_color="LabelDisabledColor">
132+
Maximum LOD resolution:
133+
</text>
134+
<combo_box
135+
control_name="RenderMaxTextureResolution"
136+
height="19"
137+
layout="topleft"
138+
left_pad="40"
139+
top_delta="0"
140+
name="MaxTextureResolution"
141+
tool_tip="Maximum resolution for 'level of detail' textures"
142+
width="90">
143+
<combo_box.item
144+
label="512"
145+
name="512"
146+
value="512"/>
147+
<combo_box.item
148+
label="1024"
149+
name="1024"
150+
value="1024"/>
151+
<combo_box.item
152+
label="2048"
153+
name="2048"
154+
value="2048"/>
155+
</combo_box>
121156

122157
<check_box
123158
control_name="RenderVSyncEnable"
@@ -152,18 +187,18 @@
152187
layout="topleft"
153188
left="30"
154189
top_delta="16"
155-
width="128"
190+
width="130"
156191
name="AvatarComplexityModeLabel"
157192
text_readonly_color="LabelDisabledColor">
158193
Avatar display:
159194
</text>
160195

161196
<combo_box
162197
control_name="RenderAvatarComplexityMode"
163-
height="18"
198+
height="19"
164199
layout="topleft"
165-
left_delta="130"
166-
top_delta="0"
200+
left_pad="40"
201+
top_delta="-1"
167202
name="AvatarComplexityMode"
168203
width="150">
169204
<combo_box.item
@@ -195,7 +230,7 @@
195230
max_val="101"
196231
name="IndirectMaxComplexity"
197232
show_text="false"
198-
top_delta="16"
233+
top_delta="19"
199234
width="300">
200235
<slider.commit_callback
201236
function="Pref.UpdateIndirectMaxComplexity"
@@ -368,7 +403,7 @@
368403
left="30"
369404
name="antialiasing label"
370405
top_delta="20"
371-
width="120">
406+
width="130">
372407
Antialiasing:
373408
</text>
374409
<combo_box
@@ -403,7 +438,7 @@
403438
left="30"
404439
name="antialiasing quality label"
405440
top_delta="20"
406-
width="120">
441+
width="130">
407442
Antialiasing Quality:
408443
</text>
409444
<combo_box
@@ -1015,7 +1050,7 @@
10151050
layout="topleft"
10161051
left="13"
10171052
name="horiz_border"
1018-
top="393"
1053+
top="415"
10191054
top_delta="5"
10201055
width="774"/>
10211056
<button

0 commit comments

Comments
 (0)