From 05a7da627959afef2198f2036f4144e3d8abfbda Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Tue, 17 Sep 2019 06:13:17 +0200 Subject: [PATCH] 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. --- builtin/settingtypes.txt | 7 ++++--- src/client/render/plain.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/builtin/settingtypes.txt b/builtin/settingtypes.txt index 8b508cf59..f73190fad 100644 --- a/builtin/settingtypes.txt +++ b/builtin/settingtypes.txt @@ -508,10 +508,11 @@ texture_min_size (Minimum texture size) int 64 # when set to higher number than 0. 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. -# It should give significant performance boost at the cost of less detailed image. -undersampling (Undersampling) enum 0 0,2,3,4 +# It should give a significant performance boost at the cost of less detailed image. +# Higher values result in a less detailed image. +undersampling (Undersampling) int 1 1 8 [**Shaders] diff --git a/src/client/render/plain.cpp b/src/client/render/plain.cpp index cc17c98c3..a130a14eb 100644 --- a/src/client/render/plain.cpp +++ b/src/client/render/plain.cpp @@ -35,7 +35,7 @@ RenderingCorePlain::RenderingCorePlain( void RenderingCorePlain::initTextures() { - if (!scale) + if (scale <= 1) return; v2u32 size{scaledown(scale, screensize.X), scaledown(scale, screensize.Y)}; lowres = driver->addRenderTargetTexture( @@ -44,21 +44,21 @@ void RenderingCorePlain::initTextures() void RenderingCorePlain::clearTextures() { - if (!scale) + if (scale <= 1) return; driver->removeTexture(lowres); } void RenderingCorePlain::beforeDraw() { - if (!scale) + if (scale <= 1) return; driver->setRenderTarget(lowres, true, true, skycolor); } void RenderingCorePlain::upscale() { - if (!scale) + if (scale <= 1) return; driver->setRenderTarget(0, true, true); v2u32 size{scaledown(scale, screensize.X), scaledown(scale, screensize.Y)}; -- 2.25.1