summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibSoftGPU
diff options
context:
space:
mode:
authorJelle Raaijmakers <jelle@gmta.nl>2022-09-13 12:10:50 +0200
committerAndreas Kling <kling@serenityos.org>2022-09-13 20:20:03 +0200
commit6dcc808994d14de3134a6fa406a118f0100a7980 (patch)
tree8ed29d01aa87b8f97f0410af6b2ff350d83a43d6 /Userland/Libraries/LibSoftGPU
parentbac7a12fb9f2028be0ae67685d6050dae17cd417 (diff)
downloadserenity-6dcc808994d14de3134a6fa406a118f0100a7980.zip
LibSoftGPU: Reduce subpixel precision from 6 to 4 bits
With 6 bits of precision, the maximum triangle coordinate we can handle is sqrt(2^31 / (1 << 6)^2) = ~724. Rendering to a target of 800x600 or higher quickly becomes a mess because of integer overflow. By reducing the subpixel precision to 4 bits, we support coordinates up to ~2896, which means that we can (try to) render to target sizes like 2560x1440. This fixes the main menu backdrop for the Half-Life port. It also introduces more white pixel artifacts in Quake's water / lava rendering, but this is a level geometry visualization bug (see `r_novis`).
Diffstat (limited to 'Userland/Libraries/LibSoftGPU')
-rw-r--r--Userland/Libraries/LibSoftGPU/Config.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibSoftGPU/Config.h b/Userland/Libraries/LibSoftGPU/Config.h
index 52ed67ead8..93aaac9077 100644
--- a/Userland/Libraries/LibSoftGPU/Config.h
+++ b/Userland/Libraries/LibSoftGPU/Config.h
@@ -21,7 +21,7 @@ static constexpr int MILLISECONDS_PER_STATISTICS_PERIOD = 500;
static constexpr int NUM_LIGHTS = 8;
static constexpr int MAX_CLIP_PLANES = 6;
static constexpr float MAX_TEXTURE_LOD_BIAS = 2.f;
-static constexpr int SUBPIXEL_BITS = 6;
+static constexpr int SUBPIXEL_BITS = 4;
// See: https://www.khronos.org/opengl/wiki/Common_Mistakes#Texture_edge_color_problem
// FIXME: make this dynamically configurable through ConfigServer