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.
This commit is contained in:
Hugo Locurcio 2019-09-17 06:13:17 +02:00 committed by SmallJoker
parent e0a85fae01
commit 05a7da6279
2 changed files with 8 additions and 7 deletions

View File

@ -508,10 +508,11 @@ texture_min_size (Minimum texture size) int 64
# when set to higher number than 0. # when set to higher number than 0.
fsaa (FSAA) enum 0 0,1,2,4,8,16 fsaa (FSAA) enum 0 0,1,2,4,8,16
# Undersampling is similar to using lower screen resolution, but it applies # Undersampling is similar to using a lower screen resolution, but it applies
# to the game world only, keeping the GUI intact. # to the game world only, keeping the GUI intact.
# It should give significant performance boost at the cost of less detailed image. # It should give a significant performance boost at the cost of less detailed image.
undersampling (Undersampling) enum 0 0,2,3,4 # Higher values result in a less detailed image.
undersampling (Undersampling) int 1 1 8
[**Shaders] [**Shaders]

View File

@ -35,7 +35,7 @@ RenderingCorePlain::RenderingCorePlain(
void RenderingCorePlain::initTextures() void RenderingCorePlain::initTextures()
{ {
if (!scale) if (scale <= 1)
return; return;
v2u32 size{scaledown(scale, screensize.X), scaledown(scale, screensize.Y)}; v2u32 size{scaledown(scale, screensize.X), scaledown(scale, screensize.Y)};
lowres = driver->addRenderTargetTexture( lowres = driver->addRenderTargetTexture(
@ -44,21 +44,21 @@ void RenderingCorePlain::initTextures()
void RenderingCorePlain::clearTextures() void RenderingCorePlain::clearTextures()
{ {
if (!scale) if (scale <= 1)
return; return;
driver->removeTexture(lowres); driver->removeTexture(lowres);
} }
void RenderingCorePlain::beforeDraw() void RenderingCorePlain::beforeDraw()
{ {
if (!scale) if (scale <= 1)
return; return;
driver->setRenderTarget(lowres, true, true, skycolor); driver->setRenderTarget(lowres, true, true, skycolor);
} }
void RenderingCorePlain::upscale() void RenderingCorePlain::upscale()
{ {
if (!scale) if (scale <= 1)
return; return;
driver->setRenderTarget(0, true, true); driver->setRenderTarget(0, true, true);
v2u32 size{scaledown(scale, screensize.X), scaledown(scale, screensize.Y)}; v2u32 size{scaledown(scale, screensize.X), scaledown(scale, screensize.Y)};