Skip to content

Commit 05a7da6

Browse files
CalinouSmallJoker
authored andcommittedSep 17, 2019
Improve undersampling settings
The setting now accepts values between 1 and 8 in the Advanced Settings menu. Values 0 and 1 now behave the same way (setting it to 1 won't disable MSAA anymore), so there's no need to expose 0 as a value. This closes #8939.
1 parent e0a85fa commit 05a7da6

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed
 

‎builtin/settingtypes.txt

+4-3
Original file line numberDiff line numberDiff line change
@@ -508,10 +508,11 @@ texture_min_size (Minimum texture size) int 64
508508
# when set to higher number than 0.
509509
fsaa (FSAA) enum 0 0,1,2,4,8,16
510510

511-
# Undersampling is similar to using lower screen resolution, but it applies
511+
# Undersampling is similar to using a lower screen resolution, but it applies
512512
# to the game world only, keeping the GUI intact.
513-
# It should give significant performance boost at the cost of less detailed image.
514-
undersampling (Undersampling) enum 0 0,2,3,4
513+
# It should give a significant performance boost at the cost of less detailed image.
514+
# Higher values result in a less detailed image.
515+
undersampling (Undersampling) int 1 1 8
515516

516517
[**Shaders]
517518

‎src/client/render/plain.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ RenderingCorePlain::RenderingCorePlain(
3535

3636
void RenderingCorePlain::initTextures()
3737
{
38-
if (!scale)
38+
if (scale <= 1)
3939
return;
4040
v2u32 size{scaledown(scale, screensize.X), scaledown(scale, screensize.Y)};
4141
lowres = driver->addRenderTargetTexture(
@@ -44,21 +44,21 @@ void RenderingCorePlain::initTextures()
4444

4545
void RenderingCorePlain::clearTextures()
4646
{
47-
if (!scale)
47+
if (scale <= 1)
4848
return;
4949
driver->removeTexture(lowres);
5050
}
5151

5252
void RenderingCorePlain::beforeDraw()
5353
{
54-
if (!scale)
54+
if (scale <= 1)
5555
return;
5656
driver->setRenderTarget(lowres, true, true, skycolor);
5757
}
5858

5959
void RenderingCorePlain::upscale()
6060
{
61-
if (!scale)
61+
if (scale <= 1)
6262
return;
6363
driver->setRenderTarget(0, true, true);
6464
v2u32 size{scaledown(scale, screensize.X), scaledown(scale, screensize.Y)};

0 commit comments

Comments
 (0)
Please sign in to comment.